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

Bodokh 15 Reputation points
2023-02-23T14:34:02.8166667+00:00

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?

Internet Information Services
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,550 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
10,287 questions
{count} vote

6 answers

Sort by: Most helpful
  1. Bodokh 15 Reputation points
    2023-02-26T16:01:16.5633333+00:00

    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.

    2 people found this answer helpful.

  2. Lex Li (Microsoft) 5,742 Reputation points Microsoft Employee
    2023-02-24T16:30:16.4166667+00:00

    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.

    1 person found this answer helpful.
    0 comments No comments

  3. Bruce (SqlWork.com) 68,716 Reputation points
    2023-02-23T18:15:25.9833333+00:00

    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.

    0 comments No comments

  4. TengFeiXie-MSFT 346 Reputation points
    2023-02-24T07:17:08.6933333+00:00

    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.

    0 comments No comments

  5. Bruce (SqlWork.com) 68,716 Reputation points
    2023-02-27T17:09:37.92+00:00

    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

    https://zcusa.951200.xyz/en-us/windows/arm/dev-kit/

    0 comments No comments

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.