We have a Visual Studio solution with several .NET 5.0 projects, one of which is a Windows Application
(TargetFramework
is net5.0-windows
). It obviously fails to build on Linux and Mac. How can we make it so that it would build or not build, depending on the OS? The scenarios we need to support are:
- Building from Visual Studio on Windows.
- Building from JetBrains Rider on Windows and Mac.
- Building from command line on Windows, Mac and Linux. For command line we currently use
dotnet build
, as well asdotnet test
anddotnet pack
which build the solution first.