question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Restoring nuget packages does not work on Mac any more

See original GitHub issue

With 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:closed
  • Created 2 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
januswcommented, May 2, 2021

What exactly is Mapsui.iOS.sln?

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.sln is 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.sln falls 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 a Mapsui.iOS.sln would be a Mapsui.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.

0reactions
januswcommented, May 3, 2021

I created it because the last time I tried it was not possible to build Mapsui.sln on Mac, but that was a long time ago. (It would be better if VS just ignored the files it can not build so we could work with one project).

Yes, UWP projects are ignored/disabled in VS4Mac without any problems. The same should be done for WPF stuff. To my understanding the NETSDK1100 errors above are a bug, and there are at least two related issues in dotnet (see above).

I created it for my own purpose, just building iOS, I never did serious development on Mac, so I just needed the iOS projects.

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).

Including the Android projects for Mac developers is good idea. I will merge the PR.

Thanks a lot 👍

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found