AspNetCore.Docs icon indicating copy to clipboard operation
AspNetCore.Docs copied to clipboard

Guidance on using ASP.NET Core 2.1 on .NET Framework

Open shirhatti opened this issue 4 years ago • 10 comments

I'm happy to PR/contribute this content, but I need guidance on where it'll live. Should it live in the latest docset? Or should it only exist for 2.1?

Issue description

I'd like to add guidance on using ASP.NET Core 2.1 on .NET Framework when hosting in IIS. Especially given that 2.1 is going out of support soon. We will no longer be producing 2.1 SDKs or 2.1 hosting bundles.

Dev Requirements:

  • A supported version of the .NET SDK to build ASP.NET Core 2.1 applications for .NET Framework

Production Requirements:

  • A supported version of the .NET Hosting bundle.

NOTE: The .NET Hosting bundle contains other .NET Runtime components. If you do not intend to use the runtime components, the guidance is to install ANCM without the runtime components.

./dotnet-hosting-x.y.z-win.exe /install /q /norestart OPT_NO_RUNTIME=1 OPT_NO_SHAREDFX=1

Build-time changes:

Add the following properties to you project file:

  <PropertyGroup>
    <AspNetCoreModuleName>AspNetCoreModuleV2</AspNetCoreModuleName>
    <AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
  </PropertyGroup>

Alternatively, if you do not want to make a build change, you could just change the published web.config to start using ANCMv2 and specify outofprocess as the hosting model.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath="WebApplication37.exe" arguments="" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="outofprocess" />
  </system.webServer>
</configuration>

shirhatti avatar Jun 18 '21 01:06 shirhatti

How about in the 2.1 docset but we can add links to it in all the newer versions? @guardrex what do you think?

Rick-Anderson avatar Jun 18 '21 03:06 Rick-Anderson

I'll work on this shortly using your suggestion.

@Pilchie if he has thoughts on any other content to add here.

shirhatti avatar Jun 21 '21 19:06 shirhatti

I can't think of anything off the top of my head, but it'll be great to have a place to point people to.

Also tagging @timheuer, @vijayrkn, and @marcpopMSFT.

Pilchie avatar Jun 21 '21 20:06 Pilchie

Feels like somewhere here (additional topic) https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-5.0 would be the right place?

timheuer avatar Jun 21 '21 21:06 timheuer

@Rick-Anderson Can we close this now that 2.1 is no longer supported?

serpent5 avatar Jan 24 '22 11:01 serpent5

Can we close this now that 2.1 is no longer supported?

@serpent5 ASP.NET Core 2.1 on .NET Framework is supported as long as .NET Framework is supported. The point of this issue is that we should do a better job of documenting how actually use that.

Pilchie avatar Jan 24 '22 17:01 Pilchie

Ok, that makes sense. Thanks @Pilchie.

serpent5 avatar Jan 24 '22 17:01 serpent5

Can we close this now that 2.1 is no longer supported?

@serpent5 ASP.NET Core 2.1 on .NET Framework is supported as long as .NET Framework is supported. The point of this issue is that we should do a better job of documenting how actually use that.

@Pilchie Does this also mean that the Hosting Bundle for this version is also in support? The support policy documents aren't super clear (https://dotnet.microsoft.com/en-us/download/dotnet/2.1), or I'm just missing something.

Also, I can't see to find any hosting bundle requirements in general; I'm assuming that the framework target must match the hosting bundle version based on trial and error with installations.

Really appreciate it. I'm in the processing of figuring out how to migrate to .net core 6, but it is not going to be a quick task.

ps92121 avatar Mar 09 '22 21:03 ps92121

Thank you for contacting us. Due to a lack of activity on this discussion issue we're closing it in an effort to keep our backlog manageable. If you believe there is a concern which hasn't been addressed, please file a new issue.

Rick-Anderson avatar Feb 08 '24 03:02 Rick-Anderson

@Rick-Anderson I'm in the situation right now that I want to know what is needed to get ASP.NET Core 2.1 - running on .NET Framework runtime - working with IIS without using out-of-support software (like the 2.1 Hosting Bundle). I can't find any documentation for that (except for this issue, thanks @shirhatti!).

Should I really create a new issue? Why not just open this issue again?

cremor avatar Jun 17 '24 06:06 cremor

Does this also mean that the Hosting Bundle for this version is also in support? The support policy documents aren't super clear (https://dotnet.microsoft.com/en-us/download/dotnet/2.1), or I'm just missing something.

Also, I can't see to find any hosting bundle requirements in general; I'm assuming that the framework target must match the hosting bundle version based on trial and error with installations.

@wtgodbe clarified in https://github.com/dotnet/aspnetcore/issues/58598#issuecomment-2596686806 that you need to use a current (still supported) version of the hosting bundle. With the options explained in the first post of this issue here.

cremor avatar Jan 16 '25 20:01 cremor