-
Notifications
You must be signed in to change notification settings - Fork 446
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
In .NET 5.0 Error #140
Comments
.NET 5 hmmm, it could be caused due to the WinRT dependency of this library (i.e. to fetch system themes and colors). One of the breaking changes in .NET 5 is the removal of built-in WinRT support.
This is due to this library having a copy of the metadata files (.winmd files in the WinMD folder) instead of depending on the said packages See this issue for reference - Microsoft.Windows.SDK.Contracts - microsoft/CsWinRT/issues/283 May be IDK 🤷♂️. Hey @Kinnara, what are your thoughts? Edit : the Microsoft.Windows.SDK.Contracts package doesn't seem to support .NET 4.5. |
⚠⚠ Important ⚠⚠ : Hey @wf-soft, I have the fixed the bug in my fork (ShankarBUS/ModernWpf) and its working for me. So do this :
Hey @Kinnara, |
@ShankarBUS I can confirm that your branch has worked. I haven't done extensive testing, but there is no longer any crash on startup. @Kinnara Here's the stack traces I get when running without these fixes. The type initializer for 'ModernWpf.ThemeManager' threw an exception. Inner Exception Inner Exception EDIT: dotnet --version ModernWpf 0.9.0 |
Hey @mlivernoche, thanks for the verification. I got the exact same exception before. There won't be any bug anymore since the only problem seemed to be with how .NET 5 interact with WinRT and not within this library. So we can believe nothing wrong will happen 😅. My fix is hard coded for .NET 5, it should modified to include .NET 6, etc when they arrive. |
@ShankarBUS Great. I've been using this library. It's very easy to use |
.NET 5.0 support has been added in the latest preview. Thank you all for your info and help! |
Hey @Kinnara Incase you're not aware, the WinRT interop mechanism has been again changed in .NET 5 Preview 8 See https://blogs.windows.com/windowsdeveloper/2020/09/03/calling-windows-apis-in-net5/ |
@ShankarBUS Didn't know that. Thanks for the info! |
@Kinnara, .NET 5 is expected to be released soon. I hope you'd polish this library for it. |
Thanks for the reminder, I'll try. |
v0.9.2 should now have proper .NET 5 support (hopefully). |
I'm getting this again with the release version of .NET 5 and ModernWpf 0.9.2.
|
Is your target framework in this format If not you may get those errors. |
@ShankarBUS Thank you, no I didn't set it to the specifik SDK version. Will this (e.g. |
No no no, it just means that your app can use APIs from the Windows 10 1903 SDK. It just the SDK you target! Not the minimum supported OS. This library has internal checks the Windows versions which the app runs to prevent errors on older Windows versions. It will run on Windows 7 & above with no problems at all! You don't have to worry about anything! |
Initialization of 'ModernWpf.ThemeResources' threw an exception.' Line number '10' and line position '18'.
The text was updated successfully, but these errors were encountered: