Home > Blockchain >  ASP.NET Core 6 app fails to start up on IIS in Windows 11 ARM OS
ASP.NET Core 6 app fails to start up on IIS in Windows 11 ARM OS

Time:03-04

Just today, Microsoft released a new Windows 11 ARM update that finally supports IIS. This in theory opens up .NET developers for being able to fully develop .NET apps on the newer Macbook Pros with M1 chips.

However, I'm running into trouble getting my ASP.NET Core 6 app to run in IIS on Windows 11 ARM.

In the advanced settings for the app pool in IIS, there is a new option "Enable emulation on ARM64". If I have this turned off (the default), then when I try to launch my app it stops the app pool and logs this error in the event log:

The Module DLL 'C:\Program Files\IIS\Asp.Net Core Module\V2\aspnetcorev2.dll' could not be loaded due to a configuration problem. The current configuration only supports loading images built for a ARM64 processor architecture. The data field contains the error number. To learn more about this issue, including how to troubleshooting this kind of processor architecture mismatch error, see http://go.microsoft.com/fwlink/?LinkId=29349.

If I enable the ARM64 emulation setting for the app pool, then I get this error on app startup: HTTP Error 500.30 - ASP.NET Core app failed to start. The event log shows this error:

Activation context generation failed for "C:\WINDOWS\system32\conhost.exe".Error in manifest or policy file "C:\WINDOWS\system32\conhost.exe" on line 0. Invalid Xml syntax.

Has anyone else gotten their ASP.NET Core 6 apps to run successfully on IIS within a Windows ARM environment?

CodePudding user response:

How did you install IIS on your Windows 11 ARM. Was it included in the latest Dev build? Reading the release notes for 22567, I do not see anything about IIS.

CodePudding user response:

I was able to get my ASP.NET apps to run under IIS within Windows 11 Preview for ARM, on my new Macbook Pro with an M1 chip; not just with .NET 6 ASP.NET apps but also with ASP.NET Core 3.1 and ASP.NET Framework apps (the new IIS app pool "Enable emulation on ARM64" setting works great!) To get past the errors in my original post, I had to:

  1. Repair my ASP.NET Core Runtime install.

  2. Repair my Windows Hosting Bundle install.

  3. Change my web.config to launch the dotnet app in a different way:

    < aspNetCore processPath="C:\Program Files\dotnet\dotnet.exe" arguments="exec "bin\Web.dll"" stdoutLogEnabled="false" hostingModel="InProcess" >

...had to be changed to:

<aspNetCore processPath="bin\Web.exe" stdoutLogEnabled="false" hostingModel="InProcess">

I believe the repairs were required because I had originally installed ASP.NET Core and the Hosting Bundle before installing IIS (since IIS didn't exist yet for this OS!)

  • Related