Which IIS Host Module should I use for .Net 8 Core Web Api?

Shastri, Shrinivas 0 Reputation points
2023-12-21T01:06:47.42+00:00

I have .Net Web Api that has been running for some time on client Windows 2022 Sever under IIS10. It uses AspNetCoreModuleV2 host module. Now client has uninstalled ASP NET Core 2.2 Host bundle that provided AspNetCoreModuleV2 due to End Of Life condition and has asked to migrate Api to use .NET8.

I have created NET8 version of Api. The NET8 runtime and host bundle has been installed on server. With uninstall of Core 2.2 Host bundle, both Api versions are not running. In IIS Web Site->IIS Authentication or Configuration Editor throws error - There was an error while performing operation. If I run Api and open URL in browser, it gives error - HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for the page is invalid. My Web Config for both versions is below.

I have tried with App Dll name in processPath="dotnet" arguments=".<>.dll" for NET8 version but nothing works. Event Viewer does not have any errors.

What host module can I use to resolve this? Does NET8 install provides host module other than AspNetCoreModuleV2 ?

<system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath="<web api>.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
    </system.webServer>
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,877 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,573 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Brando Zhang-MSFT 3,696 Reputation points Microsoft Vendor
    2023-12-21T07:42:19.1133333+00:00

    Hi @Shastri, Shrinivas,

    The asp.net 8 still use the ASP.NET Core Module v2 to host the application inside the IIS.

    So you could follow this page to download the newest version **IIS runtime support (ASP.NET Core Module v2)**18.0.23305.0 and install it.

    User's image


    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 related email notification for this thread.


  2. Bruce (SqlWork.com) 65,576 Reputation points
    2023-12-21T17:25:28.45+00:00

    Did you replace "<web api>.exe" with the actual exe name?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.