Restoring nuget packages does not work on Mac any more
See original GitHub issueWith the latest commits on master, restoring nuget packages does not work any more in VS for Mac. I get the following errors:
/usr/local/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(63,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/Users/janus/github/Mapsui/Mapsui.Rendering.Xaml/Mapsui.Rendering.Xaml.csproj]
/usr/local/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(63,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/Users/janus/github/Mapsui/Mapsui.UI.Wpf/Mapsui.UI.Wpf.csproj]
/usr/local/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(63,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/Users/janus/github/Mapsui/Samples/Mapsui.Samples.Wpf.Editing/Mapsui.Samples.Wpf.Editing.csproj]
/usr/local/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(63,5): error NETSDK1100: Windows is required to build Windows desktop applications. [/Users/janus/github/Mapsui/Samples/Mapsui.Samples.Wpf/Mapsui.Samples.Wpf.csproj]
I think this is happening since a99ae93a830b39f7abe0dad8f62e1a8feb2491b8, and it’s preventing me from building Mapsui on MacOS.
See also https://github.com/dotnet/sdk/issues/3803 and https://github.com/dotnet/sdk/issues/3592.
Any suggestions on how to fix it?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
"Could not restore packages" in Visual Studio code when ...
Select the Tools > NuGet Package Manager > Package Manager Settings menu command. · Set both options under Package Restore. · Select OK....
Read more >Troubleshooting NuGet Package Restore in Visual Studio
Select the Tools > NuGet Package Manager > Package Manager Settings menu command. · Set both options under Package Restore. · Select OK....
Read more >Visual Studio Mac 17.3 Could not restore packages
Today upgraded to 17.3 build 2102 and now getting error message when restoring nuget packages. Error: "Object reference not set to an instance ......
Read more >Nuget package restore no longer works with latest VS for Mac
My packages folder is empty, and yet when I do a Restore it gives no errors and completes after 2 seconds, and yet...
Read more >Mac agent unable to restore nuget packages. · Issue #5768
Build should be successful with any issues. Actual behavior. Failed to restore nuget packages. Repro steps. I just ran the build, no specific ......
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

Trying to answer that myself: It’s unfortunately not documented, but from the name and content it seems like this is a solution that contains everything needed to build iOS-related stuff.
Btw:
Mapsui.iOS.slnis not affected by the errors mentioned above, since it does not include the corresponding projects.In principle it would be nice if a second solution file would not be necessary at all, and until recently it actually was not really needed AFAICS. Due to the errors above it became necessary again. But IMHO it falls short of the requirements.
In general there are target platforms that can only be built on Windows (UWP/WPF), ones that can only be built on Mac (iOS/MacOS) and those that can be built on both (e.g. Android and generic libs).
Mapsui.iOS.slnfalls short in the sense that it only includes the iOS-specific stuff, but misses some of the Android (and Desktop) parts. What we’d need rather than aMapsui.iOS.slnwould be aMapsui.Mac.sln, which should include everything that could be built on Mac.@pauldendulk If you agree, I’ll throw a PR at this problem that extends and renames
Mapsui.iOS.sln.Yes, UWP projects are ignored/disabled in VS4Mac without any problems. The same should be done for WPF stuff. To my understanding the
NETSDK1100errors above are a bug, and there are at least two related issues in dotnet (see above).I pretty much only do development on MacOS, mostly because I’m targeting both iOS and Android, and also I kinda dislike Windows 😉
Unfortunately one often gets the impression that all the build tooling for .NET is still pretty Windows-centric, and Mac is a bit of a stepchild (not to speak of Linux).
Thanks a lot 👍