Local source of nuget packages doesn't exist

KSA

After opened the project in another computer and run it on VS Code, the following problem occurred:

C:\Program Files\dotnet\sdk\2.2.300\NuGet.targets(121,5): error : The 
local source C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\' 
doesn't exist.

I found the solution for the VS but no VS Code.

zivkan

The package source is probably defined in %appdata%\nuget\nuget.config. Edit this file in your favourite xml/text editor (VSCode perhaps?). You should see under a package sources element an add element that adds that file path. Comment out or delete that line.

If it's not in that file, try running dotnet restore --verbosity normal or just dotnet restore -v n. If you still only get an error message, try running dotnet new nugetconfig, or temporarily create the C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\ directory. NuGet, with normal verbosity, outputs the list of all nuget.config files that were read. Open each one until you find which one defines the local source that does not exist, so you can edit it and remove it. Or just keep the empty directory.

It's also possible that the package source is defined in a MSBuild file, rather than a nuget.config file. If that's the case, you might need to run dotnet msbuild -pp to generate a pre-processed file (the msbuild with all imports evaluated to create a single, "stand-alone" msbuild file). You then search that file for the path that doesn't exist, then scroll up until you find a comment saying what file it was defined in. You then then choose whether you edit that file.

However, it may just be easier to create an empty directory at the path.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Android Studio - local path doesn't exist

Team Foundation Server won't build because nuget packages dont exist

android gradle Local path doesn't exist

Nuget - store packages in source control, or not?

Debug and release nuget packages local repository

Nuget VS 2015 Update 2 Doesn't Find All Packages

nuget packages in local work

Deleted all the Nuget packages in my local package cache, now I can't use VS at all

Scraping data table that doesn't exist in page source

Can't restore NuGet Packages

'dotnet build' command not finding NuGet packages (they exist)

If the record exists in target but doesn't exist in source, i need to delete it

nuget.exe doesn't restore all packages

Nuget doesn't restore packages for solution, but works when executed for .csproj

Azure devops: error NU1101: Unable to find package xxx. No packages exist with this id in source(s): nuget.org

Why ReSharper doesn't add NuGet packages when it suggests to reference them?

NuGet requires TargetPlatformVersion >= 10.0.18362.0 that doesn't exist or cannot be installed?

In VS2019 nuget doesn't consider referenced projects as lib, but as nuget packages

Why does SetBasePath not work in .NET Core 3.1? I've tried adding nuget packages, but it doesn't work

Some packages can't be downloaded from Azure DevOps Artifacts feed with NuGet upstream source

android studio1.0.2 Local path doesn't exist

Local path doesn't exist android studio 1.1.0

Installing packages from local source

Exclude nuget packages from source control

Why Nuget doesn't restore packages from packages.config?

Nuget does not restore packages from source control

'Class.function' doesn't exist in current context while using a self made NuGet Package

error NU***0***: Unable to find package <packageId>. No packages exist with this id in source(s): github, nuget.org

"dotnet publish" doesn't publish nuget packages when it's older than the current published version?