-
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
Prefer32Bit flag produces invalid output assembly in .NET 7 #70776
Comments
Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov Issue DetailsDescriptionProject builds and runs using .NET 6.0 Switched to .NET 7 - Preview 5. App builds with no issues but when I run it, it immediately exits. The debug console has the follow message.
Reproduction Steps
Expected behaviorProgram should display the initial view asking for PIN number. Actual behaviorProgram immediately exits. Debug console has the following message.
Regression?Yes, this works in .NET 6.0. The main branch of the project is built using .NET 6.0 Known WorkaroundsNone Configuration
Other informationThis project uses the Avalonia UI framework.
|
This has the same root cause as #64255. How to diagnose:
This typically refers to bitness mismatch - that is trying to load for example 32bit assembly into a 64bit process. In this case the As noted in #64255 we don't plan to fix he runtime to handle this case (the complexity doesn't seem to be worth the trouble). So the simple fix is to remove the |
@agocke @VSadov : Since this is a second time it showed up I looked into this a little bit more from an "end user" point of view. A trivial repro is (using .NET 7 Preview 5):
This produces output like:
Given that it's really easy to hit this and that it is likely to affect apps migrated from .NET Framework (which might have this property set), I think we should consider doing something about this. Personally I still prefer to not fix the runtime, but instead make a change in SDK and generate a warning that |
Agreed. LGTM |
@VSadov Could you add an error to the SDK for this? And file a breaking change issue? |
Right. NT loader does not like it when a Prefer32Bit is applied to a PE32 dll and would not load it in a 64bit process. |
@VSadov should this be closed? |
yes, dotnet/sdk#27796 has just merged |
Description
Project builds and runs using .NET 6.0 Switched to .NET 7 - Preview 5. App builds with no issues but when I run it, it immediately exits.
The debug console has the follow message.
Reproduction Steps
net7
branchExpected behavior
Program should display the initial view asking for PIN number.
Actual behavior
Program immediately exits. Debug console has the following message.
Regression?
Yes, this works in .NET 6.0. The main branch of the project is built using .NET 6.0
Known Workarounds
None
Configuration
Other information
This project uses the Avalonia UI framework.
The text was updated successfully, but these errors were encountered: