Error NETSDK1100: Windows is required to build Windows desktop applications

Viewed 1876

I am new in C#, in Visual Studio for Mac, and I need to open a project which extension is ".sln".

When I try to do it, a message is displayed:

error NETSDK1100: Windows is required to build Windows desktop applications.
Unable to create package spec for project.

I think I can manage to open some files to modify the code and make it acceptable for Mac, but I don't know where to start searching.

2 Answers

You are opened solution which includes Windows desktop application (for example WinForms). It is not possible yet (at least in official / standard way) to handle such projects by Visual Studio for Mac OS X. You need to run Visual Studio on Microsoft Windows system.

Starting with net6 SDK 6.0.4xx, it will be possible to build WPF/WinForms projects on non-windows operating systems.

It requires <EnableWindowsTargeting>true</EnableWindowsTargeting> to be set in the csproj or a Directory.Build.props file.

https://github.com/dotnet/docs/issues/30076

Related