2

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

2 Answers 2

4

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

1
  • It was in the "sources" section of NuGet under prefences. Not sure but after removing it all is well! Thanks alot for the help
    – CoderLee
    Feb 23, 2019 at 4:42
2

The package source could be defined globally in the ~/.config/NuGet/NuGet.Config file. These package sources are available in Visual Studio for Mac in Preferences - NuGet - Sources.

Or the package source could be defined in a NuGet.Config file for the solution. If it is not in the global Preferences but is available if you open the Add Packages dialog then there is likely to be a NuGet.Config file somewhere either next to the solution or in a higher parent directory.

Package sources can also be defined via MSBuild in various NuGet specific MSBuild properties if you are using an SDK Style project or are using PackageReferences. That would result in the package source being added to the obj/project.assets.json file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.