-
Notifications
You must be signed in to change notification settings - Fork 305
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
8.3.0 and WinForms throws Could not load file or assembly 'WinRT.Runtime' #927
Comments
Not specific to WinForms, same problem with WinUI... At build time, a warning states that a conflict on the version of WinRT.Runtime between 2.0.0.0 and 2.1.0.0 could not be resolved. |
Happens also on WPF targeting net8.0-windows10.0.17763.0. CommunityToolkit.Mvvm v8.2.2 indeed doesn't seem to have this problem (thanks for the idea!). |
you can fix the winrt conflict by adding the nuget package Microsoft.Windows.CsWinRT but after that I get lots of namespace problems, I was able to solve them for other communitytoolkit packages like in the issue CommunityToolkit/Windows#489 but didn't work for mvvm The type or namespace name 'VectorChangedEventHandlerMethods' does not exist in the namespace 'ABI.Windows.Foundation.Collections' (are you missing an assembly reference?) 'IObservableVectorMethods' does not contain a definition for 'Do_Abi_remove_VectorChanged_1' |
Confirmed. Unable to safely upgrade to 8.3.0 into WinUI3 packaged App:
|
Same here. When upgrading
My application is targeting |
Duplicate of #923, the workaround is in #923 (comment) 🙂 |
Mvvm 8.3.0 is broken currently See CommunityToolkit/dotnet#927
Just change Works Well. |
I too was getting it, and noted that if you're using the GUI, targeting Windows 7 or 8 is ok, but targeting anything higher results in the error. Which is SUPER annoying, since I can SEE the WinRT.Runtime getting copied over into the directory |
Project = .Net 8 winforms I am facing the same problem. Suddenly a running project is looking for WinRT.Runtime 2.1.0
The best way to keep a system running is to never update anything. VS or any supporting .Net references. The advised workaround from @jarvis10211 to change the target framework to: Another thing with WinRT.Runtime is following example by creating a collection
a workaround for this is: Perfectly fine working projects are suddenly full of WinRT messages and disrupting the work. A solution is certainly needed regardless of the mentioned workarounds... |
I had problems in all my WinForms projects targeting net8.0-windows10.0.18362.0, They all ran, but in designer I could only view forms, my custom controls and usercontrols all gave the 'WinRT.Runtime, Version=2.1.0.0' error. Using Bush-cat's suggestion of adding the nuget package Microsoft.Windows.CsWinRT fixed it. |
The suggestion of @Bush-cat to add package |
Describe the bug
I just updated to CommunityToolkit.Mvvm 8.3.0 in a WinForms project targeting net8.0-windows10.0.22621.0 (and runtime identifier win-x64) and everything compiles but when the WinForms app starts I get the following exception:
I read something on the blog post announcing 8.3.0 about targeting net8.0-windows10.0.17763.0, but that gives the same exception.
Only when I target net8.0-windows does the WinForms app start correctly.
How can I get it to work with net8.0-windows10.0.22621.0 (or net8.0-windows10.0.17763.0)?
Regression
8.2.2
Steps to reproduce
Update from CommunityToolkit.Mvvm 8.2.2 to 8.3.0 produces the exeption in my project. Starting a new WinForms project from scratch targeting net8.0-windows10.0.22621.0 and runtime identifier win-x64 and CommunityToolkit 8.3.0 does not produce the exception, so there must be something else in my project that triggers the exception. Any advise where to look would be appreciated.
Expected behavior
no exception
Screenshots
No response
IDE and version
VS 2022
IDE version
17.10.6
Nuget packages
Nuget package version(s)
8.3.0
Additional context
No response
Help us help you
Yes, but only if others can assist
The text was updated successfully, but these errors were encountered: