-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ASP.NET Core module installer should be improved further for Windows ARM64 #47115
Comments
Building ASP.NET Core module with a ARM64X profile seems to be unnecessary. ARM64X has the concept of "pure forwarder DLL" so that two forwarder DLLs (one for in-process and the other for out-of-process) should be enough to integrate the existing ARM64/x64 binaries with IIS on Windows 11 ARM64. |
The proposed new folder structure is as below,
|
@joeloff do you know what were the historical reasons for the current approach? |
Historically, the hosting bundle carried both x86/x64 bits and by default installed both on an x64 machine, unless the user passed additional options to select what was installed. The idea was to support multiple hosting scenarios where servers either supported dedicated pools for x64/x86 on separate machines or on the same machine. Additionally you could opt out of installing the runtime and only install ANCM. This was to support hosting environments for self-contained .NET applications. The bundle can carry x86, x64, and arm64 content. .NET supports installing both x64/arm64 SxS, but I don't know whether ANCM currently supports that. You would need to make changes to the MSI to avoid the x64/arm64 copies stomping on each other since both would share the same location. In .NET we do this by modifying the install location so that x64 on arm64 installs to It all depends on what you want your supported scenarios to be and what IIS supports as well. |
@HaoK I believe you did the work to support arm64 - do you remember what the goal/design was for ANCM x64/arm64 side by side? |
With some help from ARM64 Process Monitor, I successfully resolved the out-of-process crash. So, by patching the current installer, it is possible to get ARM64/x64/x86 application pools working on Windows 11 ARM64 side by side properly. I created a separate repo to show the exact steps to patch the default installation, https://github.com/lextm/ancm-arm64 In short, the steps are,
I tested the It is up to you how to incorporate the findings into the hosting bundle installer. |
Consolidated all required changes in #47290. |
Thanks for additional details, @lextm. At this point we don't have enough signal to justify increasing our support matrix, as this will result in higher support cost. Hence, we're going to park this in the backlog and monitor to see how community reacts to this over time. |
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
@mkArtakMSFT Thanks for the transparency. Before enough needs are revealed, any users can apply the workaround I found in https://github.com/lextm/ancm-arm64 instead. |
This is very disappointing to hear... For anyone who is developing for .NET on a newer Macbook Pro instead of other inferior laptops, we have to run Windows 11 Preview for ARM in Parallels or VMWare. For simple setups some devs can get away with using IIS Express, but many of us require IIS and run into the dreaded "The current configuration only supports loading images built for a AMD64 processor architecture" error when running our ASP.NET Core applications. We were fortunate enough to find @lextm's github repo and apply his patches, but it would be great if Microsoft would reconsider supporting this scenario so that we can develop for .NET on Macbook Pro's without patching your ASP.NET Core dll's. And no, we can't develop directly on Mac, our applications use functionality that is only available on Windows such as SQL Server, Event log, Windows impersonation, and Windows Services. |
It's 2024 and IIS is still not working correctly on ARM64. In the meantime, to unblock migration to ARM64 (some apps rely upon IIS), I've built an unofficial installer on top of @lextm fixes (thank you very much!!!) which you can find here. It is not suitable for production, but it makes it easier to deploy the workaround for the time being and it can be used for development and prototyping as a temporary replacement of the official Hosting Bundle. |
@jimm98y ASP.NET Core module versions are associated with other ASP.NET Core bits in manifest files. Tools like JexusManager depend on such mappings to find potential issues in deployment. Your own installers often got a different version number from the official one (timestamp related) and might break such detection. So overall I don't think that is a good idea to host your own installers. |
@lextm That's why I only broke down the official bundle and re-used all the officially released bundle components, not trying to patch the MSI/EXEs inside the bundle and using scripting instead. I agree it has multiple drawbacks and in no way can it replace the official installers => I removed the released MSI. We'll probably end up moving our ASP.NET Core app out of IIS to run on Kestrel and use Url Rewrite in emulation instead. However, we can't guarantee the user won't install any other ARM64 IIS integrated app alongside ours and at that point IIS will break. Can https://github.com/lextudio/httpplatformhandlerv2/releases be used to install this patch on top of existing IIS Hosting Bundle installation? |
@jimm98y The HttpPlatformHandler v2 repo was created for a completely irrelevant goal, so it cannot help. |
@mkArtakMSFT I hope you reconsider. As a developer I purchased a new MacBook to create cross platform apps specifically with MAUI. Many developers are moving to new MAcBooks with Windows VM to develop. Frankly I would have used VS for MAC, but that is another disappointment and the reason for using a VM. Just looking for the tools I need to do my job. |
This is a bit ridiculous. The amount of time spent commenting in this thread probably took longer than it would have taken just to implement the @lextm script fix. I feel that this decision is more of a marketing strategy than anything developer-related. Currently I (and anyone else in this situation) have to run the @lextm patch every time asp modules get updated, which seems to be every VS Studio update and every other Windows Update. Does MS just not value ARM development that much? It just seems odd that the effort has been put into creating ARM versions of Windows that then get hamstring'd by little issues like this. |
Good that you mention higher costs, because I really think the cost of Windows ARM failing again will be much higher than the cost of fixing and supporting this use case. No, I don’t think this is critical, but the more apps can run unchanged in Windows ARM the better! Just reminding that Microsoft launched the first Windows on ARM in the Surface tablet in 2012 and it completely failed to gain traction as there was not really any app that would run on that besides the few ones available on the Windows store at that time. I believe one of the lessons learned is you do need compatibility so more apps can run on Windows ARM unchanged until the platform gains enough traction for developers/isvs to feel compelled to adapt/recompile their apps for the new platform. Finally, I know pure ASPNET core apps can potentially be targeted to ARM with ease but there are countless apps on the market that rely on unmanaged components that are x64 only so they do need to be executed as x64. |
I had a working IIS setup on Arm64 where I had to install the x64 URL Rewrite module and Application Request Routing module as Microsoft has not yet made an Arm64 version of these modules but this worked fine until I installed the .NET 9 hosting bundle which then breaks IIS due to the application pools running x64 mode so it can't load .NET but if I change the application pools to disable the emulation mode then it fixes that crash but then I get a different crash with the rewrite module then not loading due to that being x64 so it seems it is not possible for URL rewrite and .NET 9 to coexist on the same server over IIS. This is because Microsoft have not yet either, developed Arm64 versions of the common IIS modules, or whilst the functionality is there in the application pools to run in different modes, the .NET hosting bundle does not allow this as the community fix supplied by @lextm over a year and a half ago was not taken forward, or anything else to fix this. I would have thought wanting URL rewriting and to be able to host .NET projects on IIS at the same time would be a pretty common requirement so it seems surprising there isn't a way and perhaps I was being a bit hasty moving over everything to Arm64 if basic support is lacking in some areas. It's a shame as Windows itself runs really well with with great battery life so it seems the hard work has already been done. |
@robinwilson16 URL Rewrite module is actually available for ARM64 if you follow these steps, but ARR isn't yet. |
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
The current installer (.NET 7 for example) does the following on Windows 11 ARM64,
Program Files
.Program Files (x86)
.So, if people try to create three application pools on IIS for ARM64, x64, and x86, they can only get things running in the ARM64 pool (
enableEmulationOnWinArm64
set tofalse
andenable32BitAppOnWin64
set tofalse
). All other pools will crash.Describe the solution you'd like
The changes should be made are,
Program Files (x86)
, which resolves x86 application pools.aspnetcorev2.dll
andaspnetcorev2_outofprocess.dll
and install them along with arm64/x64 bits toProgram Files
. This resolves both in-process and out-of-process modes for arm64/x64 application pools.This should allow all three kinds of application pools to run properly and maximize compatibility.
A all-in-one pull request is currently opened, #47290.
Additional context
I tried to build ASP.NET Core module with a ARM64X profile, but found quite a few hurdles (changes to compiler settings, extra defines and missing files to include). I guess that's why this hasn't been finished in .NET 7 timeline.
Hope it can be done in .NET 8 to complete Windows ARM64 support.
The text was updated successfully, but these errors were encountered: