-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Blazor app is broken by AOT in .NET9.0 update #109894
Comments
Tagging subscribers to this area: @BrzVlad, @kotlarmilos |
Please provide a complete repro app and steps manifesting this issue. On macos, I tried a new Moved with trying to reproduce via visual studio and once again didn't get any crashes. |
Apologies, it was on my end. In my curated deployment script, some framework files were missed in my migration efforts to accommodate 9.0's new filename.HASH.wasm format, leading the the NIY errors. I didn't catch this because there were no clear errors that files were missing, other than what now seems as obvious clues in retrospect. |
No problem, glad it worked out |
Description
Previously working Blazor code now broken by .NET9.0 when code is AOT'd. I had issues with my own code, but even with counterintuitive workarounds, I also had issues with established NuGet packages, such as using BouncyCastle encryption, which will be my example here
Reproduction Steps
NuGet package BouncyCastle.Cryptography version 2.4.0
For example
X9ECParameters x9EC = NistNamedCurves.GetByName("P-521");
Expected behavior
No Error
Actual behavior
Runtime error:
MONO interpreter: NIY encountered in method Org.BouncyCastle.Asn1.Nist.NistNamedCurves:.cctor ()
Regression?
Worked correctly in .Net8.0
Known Workarounds
This is one example of a symptom that I've experienced in multiple aspects of my app. I've refactored some code to convert interfaces to classes when the AOT version would generate these errors and that seems to work but I don't know why. I believe it has something to do with static elements in interfaces, but I wasn't able to reliably pin down a workaround strategy other than converting problematic interfaces to classes.
As much as I was able to perform workarounds with my own code, now this issue is impacting packages like BouncyCastle that I cannot manually modify with this workaround, so my code remains broken with no workaround other than the non-option of not AOT'ing the code.
Configuration
.NET9.0
Latest Win11 x64
doesn't appear related to my hardware
Problem appears in latest chrome
Other information
No response
The text was updated successfully, but these errors were encountered: