Search code examples
.net-corenugetvisual-studio-macproject-settings

How to Set Local/Remote sources for NuGet in Visual Studio Mac


NuGet is not working on my Mac. It's trying to use a directory from a deleted project for every single project I make now. I'm not sure where the setting is at for NuGet on Visual Studio for Mac, but I am constantly (even after uninstalling then re-installing) getting these,

The local source '/Users/username/Projects/IMS/IMS/bin/Debug' doesn't exist.

or

Cannot resolve '/Users/username/Projects/IMS/IMS/bin/Debug' remote source.

in the NuGet/Package console output. I can't figure out how or why NuGet keeps defaulting to some IMS directory, and this is making installation of any non-local packages impossible. Any help or advice is appreciated


Solution

  • Firstly, it looks like an issue with .csproj. I would check if .csproj is having packages from this path. If yes, then I would delete them and add them again.

    It's quite easy to check if it is a Nuget issue. Try adding some popular C# library from nuget to your project (doesn't matter which one). If it adds then it works fine. If you still want to check Nuget settings you have them in: Visual Studio ->Preferences -> Nuget -> Sources
    Nuget location should be https://api.nuget.org/v3/index.json