Incorrect warning about WindowsDesktop SDK
See original GitHub issueI have a project that has some libraries/exe that use WPF and some that don’t. The ones that do use the WindowsDesktop SDK. The ones that don’t use the default SDK to prevent accidental WPF references.
I have a directory.build.props file that sets UseWPF
to true
so that I don’t need them in all places.
In Preview 7, I now get this warning:
1>C:\Program Files\dotnet\sdk\3.0.100-preview7-012503\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.targets(340,5): warning NETSDK1107: Microsoft.NET.Sdk.WindowsDesktop is required to build Windows desktop applications. 'UseWpf' and 'UseWindowsForms' are not supported by the current SDK.
That’s coming from Microsoft.NET.Sdk.DefaultItems.targets
. The check is being too aggressive.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:13 (12 by maintainers)
Top Results From Across the Web
How can I eliminate warning NETSDK1137 in a .NET 5 ...
NET 5. Warning NETSDK1137 It is no longer necessary to use the Microsoft.NET.Sdk.WindowsDesktop SDK. Consider changing the Sdk attribute of ...
Read more >NETSDK1137: Don't use the Microsoft.NET.Sdk. ...
To resolve this error, modify your project file to have <Project Sdk="Microsoft.NET.Sdk"> instead of the WindowsDesktop SDK.
Read more >Microsoft.NET.Sdk.WindowsDesktop is required to build ...
When compiling my EXE I am seeing a warning that says: warning NETSDK1107: Microsoft.NET.Sdk.WindowsDesktop is required to build Windows ...
Read more >NET Core 3.0 WPF App - The SDK Microsoft. ...
Description Of Issue: I have a WPF app that uses the sdk Microsoft.NET.Sdk.WindowsDesktop and NET Core 3.0 Preview 7.
Read more >Rider creates invalid project for ".NET Core / Desktop ...
I chose this project type, and set the target framework to ".NET Framework 4.7.2" (to get an SDK-style project, for easy later multi-targeting)....
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 FreeTop 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
Top GitHub Comments
We have seen two kinds of problem reports:
i. Failing to change
Microsoft.NET.Sdk
toMicrosoft.NET.Sdk.WindowsDesktop
, settingUseWpf
(orUseWindowsForms
) totrue
, and attempting to build/port a WPF app (which, unsurprisingly, fails to build as expected)ii. Using
Microsoft.NET.Sdk.WindowsDesktop
, but failing to setUseWpf
orUseWindowsForms
totrue
. Again, fails to build as expected.We wanted to add suppressible warnings to help with both scenarios. This addresses the first one.
That should do it, I think.