-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
WPF for .NET Core throws first chance exceptions due to .NET Core limitations #2395
Comments
This also appears in Line 35 in 24faa3f
|
/cc @JeremyKuhne @maryamariyan AppSettings should be usable on .NETCore (see https://gist.github.com/ericstj/20497889f9d71ceb5d0f5fcc84cdede1), though we wouldn't recommend building new things around it. @AArnott it looks like you're hitting this: Perhaps you're hitting this because the way you're hosting CoreCLR doesn't set EntryAssembly? That might be something to try to root cause here: I suspect other things might fallout of this. |
Oh, quite possibly. I'll see if I can figure out how to set that EntryAssembly property. So far the only property I'm setting is |
Looks to be the issue discussed here: https://github.com/dotnet/corefx/issues/27091. I couldn't find any hook to set EntryAssembly. As @jkotas mentioned it's only set on the appdomain when ExecuteMainMethod is called. |
Thanks @ericstj for checking into it. @AArnott WPF isn't going to change that code in any significant fashion unless there is an overriding need to. There are significant switches that help ensure backward compatibility with .NET Framework and minimize problems with porting to .NET Core that we want to preserve. All of these are based around ConfigurationManager. I'm going to close this as there doesn't seem like any actions for WPF here. |
Hi, |
Hi, @ivan2007. Can you attach your information to this dotnet/runtime#25027? This is a runtime issue. Thanks. |
Hi @ryalanms, I can't attach my information because the issue dotnet/runtime#25027 is locked |
@ivan2007 Then open a new issue in dotnet/runtime. It looks like the problem was fixed in .NET 5.0, but you need the fix in 3.1. WPF cannot help you - it's a runtime issue. |
Even with that exception, I suspect it is caught and handled. If you aren't trying to use an app.exe.config file you're likely fine and not impacted by the config-system's failure to locate the config file. Those are just first chance exceptions that clutter the debug output. @SamBent / @ryalanms WPF could eliminate it's use of ConfigurationManager. Of course that would be something to consider in a future version. |
Problem description:
WPF for .NET Core throws a multiple first-chance exceptions during startup because AppSettings isn't available on .NET Core.
wpf/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/CoreCompatibilityPreferences.cs
Line 23 in 24faa3f
Actual behavior:
Expected behavior:
I expect WPF for .NET Core avoids calling APIs that are known to not work on .NET Core so that these first chance exceptions aren't thrown.
The text was updated successfully, but these errors were encountered: