У нас вы можете посмотреть бесплатно Resolving WinRT.Runtime Version Conflicts in WinUI 3 with .NET 8 and .NET 9 Projects или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Learn how to fix incompatible WinRT.Runtime assembly version issues in a multi-project WinUI 3 solution targeting .NET 8 and .NET 9 by updating TargetFramework and removing manual SDK version settings. --- This video is based on the question https://stackoverflow.com/q/79421277/ asked by the user 'Arthur Buzas Baccan' ( https://stackoverflow.com/u/15107943/ ) and on the answer https://stackoverflow.com/a/79424118/ provided by the user 'Arthur Buzas Baccan' ( https://stackoverflow.com/u/15107943/ ) at 'Stack Overflow' website. Thanks to these great users and Stackexchange community for their contributions. Visit these links for original content and any more details, such as alternate solutions, latest updates/developments on topic, comments, revision history etc. For example, the original title of the Question was: Incompatible WinRT.Runtime versions between projects in the same Solution (Winui3, .Net 8) Also, Content (except music) licensed under CC BY-SA https://meta.stackexchange.com/help/l... The original Question post is licensed under the 'CC BY-SA 4.0' ( https://creativecommons.org/licenses/... ) license, and the original Answer post is licensed under the 'CC BY-SA 4.0' ( https://creativecommons.org/licenses/... ) license. If anything seems off to you, please feel free to drop me a comment under this video. --- Introduction When working with WinUI 3 applications that use multiple projects within a single solution—especially with .NET 8 and Windows App SDK—it is common to encounter assembly version conflicts. One frequent issue is incompatible versions of the WinRT.Runtime assembly referenced across projects, which prevents successful compilation despite no syntax errors. The Problem The error typically looks like this: [[See Video to Reveal this Text or Code Snippet]] This mismatch means some projects reference newer WinRT.Runtime versions than others, causing build failures. Root Cause Explicitly specifying the Windows SDK version manually in a project file (View.csproj) can cause conflicts. This line was often added as a workaround for a WinUI 3 bug in .NET 8 but becomes problematic after Visual Studio or SDK updates. Targeting different .NET framework versions or manually locking the SDK version leads to referencing different WinRT.Runtime versions. Solution 1. Upgrade Target Framework Update the main application project to target .NET 9 (or the latest stable version) instead of .NET 8: [[See Video to Reveal this Text or Code Snippet]] This aligns with the latest Windows App SDK releases and resolves many version conflicts. 2. Remove Manual Windows SDK Version Setting Delete or comment out the following property that pins the Windows SDK version: [[See Video to Reveal this Text or Code Snippet]] Instead, rely on the TargetFramework to manage the SDK version implicitly. 3. Set SupportedOSPlatformVersion Properly Add or update the SupportedOSPlatformVersion property to match the targeted Windows SDK: [[See Video to Reveal this Text or Code Snippet]] This explicitly states the minimum supported Windows version. Updated View.csproj Snippet Here's a simplified, corrected version of the main project file setup: [[See Video to Reveal this Text or Code Snippet]] Additional Tips Ensure all projects targeting Windows UI are synchronized on the same Target Framework. Avoid hard-coding SDK versions unless absolutely necessary. Regularly update NuGet packages related to WinUI and Windows App SDK to latest stable versions. Use Visual Studio's automatic update and tooling support to manage dependencies. Conclusion Version conflicts in WinRT.Runtime typically stem from manual SDK version overrides and mismatched target frameworks. The modern approach is to update projects to .NET 9+ and remove explicit Windows SDK version settings, letting the Target Framework handle compatibility. This ensures consistent assembly versions across projects and smooth compilation. Following these steps will resolve incompatible WinRT.Runtime errors in WinUI 3 solutions on .NET 8 and .NET 9.