How do I get .NET 6 into the Application Pool on Windows Server 2019?

Rod At Work 866 Reputation points
2022-11-10T22:39:42.077+00:00

I'm trying to publish an ASP.NET MVC project I've been working on, to a Windows Server 2019 Datacenter server. It has IIS 10 on it. My experience, at installing on Windows Servers, is installing older .NET Framework applications onto those servers. However, this application I've been working on is written using .NET 6. I would think that I'd have to create a new application pool in IIS, to point to the .NET 6. When I got into IIS on the server, I didn't see .NET 6 as an option in Application Pools. All that is there is:

.NET CLR Version v4.0.30319

So, I searched for a way of doing this and came across a post put into these forums titled Running Net 6 Web App on IIS. That's close, but it doesn't address what I think I need to do. (If I'm wrong and there's a different way of specifying the .NET version a website is to use, instead of Application Pools, please let me know.)

So, next I tried installing .NET 6.0.11 Windows Hosting bundle, which I was under the impression would make using .NET 6 within IIS easier. It still doesn't show up in IIS as an application pool. So, what am I doing wrong? What am I misunderstanding? What do I do to make my ASP.NET MVC app built using .NET 6 work on a Windows Server 2019 in IIS 10?

Internet Information Services
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,283 questions
0 comments No comments
{count} votes

Accepted answer
  1. Yurong Dai-MSFT 2,806 Reputation points Microsoft Vendor
    2022-11-11T03:31:20.393+00:00

    Hi @Rod At Work ,

    .NET Core and .NET 5+ versions have only one product version, i.e. there is no separate CLR version, and not every new version of .NET ships with a new version of the CLR. What you see now in IIS Manager is the latest UI with Microsoft explicitly listing the CLR version. What you see now is correct, you only have one choice and that is .NET CLR Version v4.0.30319. Even if you have the .Net 6 Hosting Bundle installed, you won't see .NET 6 as an option in the application pool. 4.x just means "anything since 4.0".

    259305-image.png

    .NET 5 is the next major version of .NET Core after 3.1. This new version is named .NET 5, not .NET Core 4. .NET 6 provides the final part of the .NET Unification initiative, which was launched in .NET 5. Since .NET 5 is based on .NET Core, the application pools we create are not loaded into the .NET Framework runtime environment. All .NET 5+ applications will run by calling an external dotnet process, which is why we need to install a separate hosting package in the first place.

    This means that when you create an application pool, you need to set the .NET CLR version to "No Managed Code" because the Core Common Language Runtime (CoreCLR) for .NET Core is booted to host the app in the worker process, not the desktop CLR (.NET CLR). As follows:

    259343-image.png


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the email notification for this thread.

    Best regards,
    Yurong Dai

    4 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Rod At Work 866 Reputation points
    2022-11-13T14:38:52.417+00:00

    @Yurong Dai-MSFT , I did see the "No Managed Code" option in the Edit Application Pool download. So, I select that, then when I publish the application to that webserver, it will work?