Build Error on .NET 5
See original GitHub issueAfter upgrading from .NET 5 preview 7 to .NET 5 RC 2 I’m getting this error on project build:
Microsoft.NET.Sdk.targets(934, 5): [NETSDK1130] Referencing a Windows Metadata component directly when targeting .NETCoreApp,Version=v5.0 is not supported. Use the C#/WinRT projection tool (https://aka.ms/cswinrt) or a provided projection for this target.
To reproduce:
Create WPF app using .NET 5, install newest version of ModernWpfUI (I’m getting error on older versions too), run build.
Thanks in advance!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:16 (5 by maintainers)
Top Results From Across the Web
NETSDK1045: The current .NET SDK does not support ...
This error occurs when the build tools can't find the version of the .NET SDK that's needed to build a project. This is...
Read more >Build error when using .NET 5 · Issue #4559 · dotnet/core
Hi,. I'm receiving the following error while building a application for Windows: error NETSDK1045: The current .NET SDK does not support ...
Read more >Net 5 Scaffoling "Build failed. Use dotnet build to see the ...
1 Answer 1 ... Make sure any assembly projects included in your main project build successfully. Clean your project and make sure it...
Read more >Azure Devops Build failing for .Net 5 when using multiple ...
I have a project that builds using the following frameworks: <TargetFrameworks>netstandard2.0;netstandard2.1;net5.0</TargetFrameworks>.
Read more >Error in sonarqube while executing dotnet build
Hello All, I am new to this Sonarqube, so i thought to doing a test into my local project. I downloaded the sonarqube...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@rfloresarg just change targetframework to this:
net5.0-windows10.0.18362.0The project needs to target net5.0-windows10.0.18362.0 or higher, since this library calls WinRT APIs. You can find related documentation here. The app will still be able to run on older versions of Windows.