upgrade to .NET 6 and deploy on IIS

Manjula Bangalore Muniyappa 1 Reputation point
2022-05-25T21:51:11.777+00:00

Hello All,

I upgraded .Net Core2.0 project which was deployed in IIS (Windows server 2012 R2) to .NET 6 .

I installed following sdk on the server.


aspnetcore-runtime-6.0.5-win-x64
dotnet-hosting-6.0.5-win
dotnet-runtime-6.0.5-x64
dotnet-sdk-6.0.300-win-x64
Vc-redist.x64


I upgraded the project to .NET 6 and changed the web.config

<handlers>

  <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />

</handlers>

<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" hostingModel="InProcess">
<environmentVariables />
</aspNetCore>

locally it works fine but when deployed on the server IIS, I am getting 500 error.


HTTP Error 500.0 - ASP.NET Core IIS hosting failure (in-process) Troubleshooting steps:

Check the system event log for error messages

Enable logging the application process' stdout messages

Attach a debugger to the application process and inspect

For more information visit: https://go.microsoft.com/fwlink/?LinkID=2028526


Event log shows:

Failed to start application '/LM/W3SVC/1/ROOT/ourapplicationName ', ErrorCode '0x800700c1'.

Process Id: 5272.

File Version: 16.0.22108.5. Description: IIS ASP.NET Core Module V2. Commit: e5f183b656a0e8bc087108130a5a9b54ae94494e

Internet Information Services
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,289 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sam Wu-MSFT 7,036 Reputation points Microsoft Vendor
    2022-05-26T02:40:54.96+00:00

    @Manjula Bangalore Muniyappa

    There are many reasons for this error, you can try to fix the problem by setting enable 32 bit Applications to True.

    1. Open IIS.
    2. Go to current server – > Application Pools.
    3. Select the application pool your 32-bit application will run under.
    4. Click Advanced setting and set Enable 32-bit Applications to True.

    If this solution can't solve the problem, you can use event log or failed request trace to get more details about 500 error.


    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.

    0 comments No comments