Unable to run .net 4.8 apps on IIS using Arm processor (M1 Max)

Bodokh 0 Reputation points

I have a macbook pro with M1 max processor running windows 11 pro in Parallels using the most updated version as to writing this message.

When trying to run .net 4.8 app on IIS I get the following error in the event viewer:

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 AMD64 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.

I have no projects using aspnetcorev2.dll so I don't understand how this error even makes sense.

Any ideas?

A Microsoft web application framework that implements the model-view-controller (MVC) design pattern.
729 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
4,067 questions
Internet Information Services
A set of technologies in the .NET Framework for building web applications and XML web services.
1,318 questions
{count} votes

5 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 31,096 Reputation points

    the error indicates you have installed the amd64 version of the .NET Core Hosting Bundle (maybe you installed the intel version of VS in the past). the core module is for IIS to host .net core apps, which you could just run native on the Mac. it is not used for old framework.

    use of the core module is specified in the site's web.config.

  2. TengFeiXie-MSFT 166 Reputation points Microsoft Vendor

    Hi @Bodokh

    Here are some suggestions for you.

    1. To enable IIS to run applications in the 32-bit mode. Then test again.
      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.
      5. Set Enable 32-bit Applications to True.
    2. If the first method doesn't work. You can remove and reinstall ASP.NET Core Module v2.

    Best Regard,

    TengFei Xie

    If the answer is the right solution, please click "Accept Answer" and kindly upvote. 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.

  3. Lex Li (Microsoft) 3,286 Reputation points

    If you don't need to host ASP.NET Core web apps there, go to Control Panel | Programs to uninstall "Microsoft .NET x.x.x - Windows Server Hosting".

    If you do need to host ASP.NET Core, then you need to learn that there are three kinds of application pools you can configure now on IIS,

    1. ARM64 application pools. That requires the new application pool setting enableEmulationOnWinArm64 to be set to false (as its default value is true) and enable32BitAppOnWin64 to false.
    2. x64 application pools. enableEmulationOnWinArm64 to be set to true and enable32BitAppOnWin64 to false.
    3. x86 application pools. enableEmulationOnWinArm64 to be set to true and enable32BitAppOnWin64 to true.

    So far, the latest hosting bundle (.NET 7/8) only installs ARM64 build of ASP.NET Core module to the same machine, without x64/x86 builds. Therefore, you can only run ARM64 build of your web app in ARM64 application pools.

    If you want to at least make ASP.NET Core module compatible with all three kinds of application pools, you need to perform an extra step to patch your hosting bundle installation with the support files I prepared in this GitHub repo

    If you install hosting bundles for older .NET Core releases (.NET 6 for example), it installs x64/x86 build of ASP.NET Core module. Then all your web apps must be run in x64 or x86 compatible application pools, but not ARM64.

    Ideally in the future IIS should introduce new values in preCondition to configure all three builds (ARM64/x64/x86) separately in globalModules section. That will allow all builds of ASP.NET Core module to work together on the same machine. Things might change in the future.

  4. Bodokh 0 Reputation points

    I managed to solve this by setting "Enable Emulation on Arm64" to false, which was very surprising.

    But now the same error happens for the module IIS Rewrite... So no solution for that yet.

  5. Bruce (SqlWork.com) 31,096 Reputation points

    the IIS url rewrite module has not been ported to arm, so it is not yet available.

    note: windows developer support on arm is fairly new and not complete. while MS created a dedicated hardware device and dev kit, it still underperforms m1/parallels/windows 11. You might want to follow the dev kit progress