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.
asked Sep 13, 2021 at 8:43
2
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
answered Jul 19, 2022 at 14:04
smkanadlsmkanadl
93810 silver badges11 bronze badges
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.
answered Mar 18, 2022 at 18:52
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.
asked Sep 13, 2021 at 8:43
2
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
answered Jul 19, 2022 at 14:04
smkanadlsmkanadl
93810 silver badges11 bronze badges
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.
answered Mar 18, 2022 at 18:52
Version
092f0ca
Flavor
GUI (Graphical User Interface), CLI (Command Line Interface)
Export format
No response
Details
I was following build instructions, installed dotnet 3.1 and 5.0, and tried to build from a clone of the repo with Ubuntu.
Running sudo dotnet build
still did not work, though. As shown:
Microsoft (R) Build Engine version 16.7.2+b60ddb6f4 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
/usr/share/dotnet/sdk/3.1.414/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(59,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/trent/DiscordChatExporter/DiscordChatExporter.Gui/DiscordChatExporter.Gui.csproj]
Build FAILED.
/usr/share/dotnet/sdk/3.1.414/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(59,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/home/trent/DiscordChatExporter/DiscordChatExporter.Gui/DiscordChatExporter.Gui.csproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:02.30
Steps to reproduce
- use Ubuntu
git clone https://github.com/Tyrrrz/DiscordChatExporter/
wget https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y apt-transport-https
sudo apt-get update
sudo apt-get install -y dotnet-sdk-5.0
sudo apt-get install -y dotnet-sdk-3.1
cd DiscordChatExporter
sudo dotnet build
Я новичок в C#, в Visual Studio для Mac, и мне нужно открыть проект с расширением «.sln».
Когда я пытаюсь это сделать, появляется сообщение:
error NETSDK1100: Windows is required to build Windows desktop applications.
Unable to create package spec for project.
Думаю, мне удастся открыть некоторые файлы, чтобы изменить код и сделать его приемлемым для Mac, но я не знаю, с чего начать поиск.
2 ответа
Лучший ответ
Начиная с net6 SDK 6.0.4xx
, можно будет создавать проекты WPF/WinForms в операционных системах, отличных от Windows.
Требуется, чтобы <EnableWindowsTargeting>true</EnableWindowsTargeting>
был установлен в файле csproj
или Directory.Build.props
.
https://github.com/dotnet/docs/issues/30076
2
smkanadl
19 Июл 2022 в 17:04
Вы открываете решение, которое включает в себя настольное приложение Windows (например, WinForms). Пока невозможно (по крайней мере, официальным/стандартным способом) обрабатывать такие проекты с помощью Visual Studio для Mac OS X. Вам необходимо запустить Visual Studio в системе Microsoft Windows.
2
Skipper
18 Мар 2022 в 21:52
Description
In a solution with separate macOS and Windows Desktop projects, paket install
now fails with errors such as:
/usr/local/share/dotnet/sdk/6.0.300/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(90,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/Users/jwostenberg/Code/Interstellar/src/Interstellar.Wpf.Chromium/Interstellar.Wpf.Chromium.fsproj]
/usr/local/share/dotnet/sdk/6.0.300/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(90,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/Users/jwostenberg/Code/Interstellar/Examples/Examples.Wpf.Chromium/Examples.Wpf.Chromium.fsproj]
/usr/local/share/dotnet/sdk/6.0.300/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(90,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/Users/jwostenberg/Code/Interstellar/src/Interstellar.WinForms.Chromium/Interstellar.WinForms.Chromium.fsproj]
/usr/local/share/dotnet/sdk/6.0.300/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(90,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/Users/jwostenberg/Code/Interstellar/Examples/Examples.WinForms.Chromium/Examples.WinForms.Chromium.fsproj]
Total time taken: 10 milliseconds
Paket failed with
-> dotnet restore "Interstellar.Windows.sln" failed
Repro steps
- Have a repo with two solutions and two projects
1a.MyProject.Windows.sln
which containsMyProject.Windows.fsproj
with a TFM ofnet6.0-windows
1b.MyProject.macOS.sln
which containsMyProject.macOS.fsproj
with a TFM ofnet6.0-macos
- On macOS, try to do a
dotnet paket install
Expected behavior
paket install
should work and not fail
Actual behavior
Paket blows up
Known workarounds
Downgrade to Paket 6.0.13.
Description
In a solution with separate macOS and Windows Desktop projects, paket install
now fails with errors such as:
/usr/local/share/dotnet/sdk/6.0.300/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(90,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/Users/jwostenberg/Code/Interstellar/src/Interstellar.Wpf.Chromium/Interstellar.Wpf.Chromium.fsproj]
/usr/local/share/dotnet/sdk/6.0.300/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(90,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/Users/jwostenberg/Code/Interstellar/Examples/Examples.Wpf.Chromium/Examples.Wpf.Chromium.fsproj]
/usr/local/share/dotnet/sdk/6.0.300/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(90,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/Users/jwostenberg/Code/Interstellar/src/Interstellar.WinForms.Chromium/Interstellar.WinForms.Chromium.fsproj]
/usr/local/share/dotnet/sdk/6.0.300/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(90,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/Users/jwostenberg/Code/Interstellar/Examples/Examples.WinForms.Chromium/Examples.WinForms.Chromium.fsproj]
Total time taken: 10 milliseconds
Paket failed with
-> dotnet restore "Interstellar.Windows.sln" failed
Repro steps
- Have a repo with two solutions and two projects
1a.MyProject.Windows.sln
which containsMyProject.Windows.fsproj
with a TFM ofnet6.0-windows
1b.MyProject.macOS.sln
which containsMyProject.macOS.fsproj
with a TFM ofnet6.0-macos
- On macOS, try to do a
dotnet paket install
Expected behavior
paket install
should work and not fail
Actual behavior
Paket blows up
Known workarounds
Downgrade to Paket 6.0.13.