dotnet / AspNetCore.Docs

Documentation for ASP.NET Core
https://docs.microsoft.com/aspnet/core
Creative Commons Attribution 4.0 International
12.64k stars 25.29k forks source link

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

Open shirhatti opened 3 years ago

shirhatti commented 3 years ago

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:

Production Requirements:

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>
Rick-Anderson commented 3 years ago

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

shirhatti commented 3 years ago

I'll work on this shortly using your suggestion.

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

Pilchie commented 3 years ago

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.

timheuer commented 3 years ago

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?

serpent5 commented 2 years ago

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

Pilchie commented 2 years ago

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.

serpent5 commented 2 years ago

Ok, that makes sense. Thanks @Pilchie.

ps92121 commented 2 years ago

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.

Rick-Anderson commented 9 months ago

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.

cremor commented 5 months ago

@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?