runtime: Generated exe files don't work on arm64

Description

When making a project that generates an exe file on AnyCPU (the default), the exe file should work on Windows on arm.

Reproduction Steps

Make a .NET Project that generates an exe file (eg. wpf, winforms, console). Compile the project. Install the .NET 6.0.1 Runtime (or Desktop Runtime, which is what I’m using) on the arm machine.

Expected behavior

Running the exe on the arm machine file runs the program as expected.

Actual behavior

Run the .exe file on Windows on arm and note that nothing happens, except the console output:

Failed to load the dll from [C:\Program Files\dotnet\host\fxr\6.0.1\hostfxr.dll], HRESULT: 0x800700C1
The library hostfxr.dll was found, but loading it from C:\Program Files\dotnet\host\fxr\6.0.1\hostfxr.dll failed
  - Installing .NET prerequisites might help resolve this problem.
     https://go.microsoft.com/fwlink/?linkid=798306

Regression?

I think so - I’m pretty sure in earlier rc versions of .NET 6.0 it was opening, but I had other issues with these versions, which seem to be fixed in the latest version.

Known Workarounds

Run dotnet <path-to-dll>.dll instead. This isn’t a proper workaround since it doesn’t use icons and manifests etc.

Configuration

.NET 6.0.1 Windows 11.0.22000.376 arm64 (on Parallels). It is specific to Windows on arm.

Other information

No response

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 19 (14 by maintainers)

Most upvoted comments

I had a similar requirement: we have a large app with many DLLs that is compiled for Any CPU and as we migrated it from NET Framework to NET Core, we wanted to add support for ARM64. Publishing it for x64 and ARM64 would have doubled our build time and also the output size. That’s why I tried to make the build to compile only once (Portable, Framework-dependent, Any CPU) and get all the EXEs into the output folder. Using “dotnet <app>” is not possible in our case, because we needed the shortcuts in the Start menu with icons, version, copyrights, etc. My solution is here: https://github.com/jimm98y/MultiTargetingSample

It generates 3 EXEs in the publish output: MultiTargetingSampleApp.exe (x64) MultiTargetingSampleApp_x86.exe MultiTargetingSampleApp_ARM64.exe