Visual Studio does not load DLL for NuGet package

We have several NuGet packages on our local TeamCity server and use them in various projects. I just returned from vacation, grabbed the latest version from the source code and tried to rebuild, only to get a bunch of compilation errors due to the lack of a DLL.

It seems that the DLL for one of our packages did not load from NuGet. I tried to start a new WPF project and add three packages. All three are displayed in the packages.config file, but only two of them load DLLs. The third only downloads the * .pdb file.

Someone else on the team has this problem, and I tried it on my spare machine, and it booted normally, so this seems like a problem with my machine, installing Visual Studio or NuGet. However, since I can easily capture other packages from the same source, this does not seem to be a global problem with VS or NuGet.

I understand that not so much, but I do not know what else to tell you. If anyone can offer anything, I would be very grateful. Since the source of the package is our own, I cannot share this, unfortunately.

I am using Visual Studio Enterprise 2015 Update 3 (build 14.0.25424.00) with the NuGet package manager version 3.4.4.1321 on the 64-bit version of Windows 10 Pro (version 1607, build 14393.105). If there is anything else I can add, please let me know.

+12
visual-studio-2015 nuget
source share
3 answers

Putting this as an answer so that others can find it, although you seem to have found the answer yourself. I went through this problem, so I understand your problem.

Close all instances of Visual Studio first. This is generally a good idea when you do something outside of VS that will affect what VS thinks.

As you saw, you need to use the nuget command line version to clear the cache. Your first problem is to find this, as it is not obvious. The second problem (if you are looking for it) is that you will find many of them: one in the .nuget folder in each solution.

The easiest way to get around this is to download the latest version of nuget.exe from your website. Keep it somewhere away from any projects if you need it.

At this point, you won’t be able to run the command to clear the cache, since you need to update nuget first. I agree that this seems strange given that you just downloaded the latest version, but you will need to do the following ...

nuget update -self 

Once you do this, you can clear the cache as jessehouwing pointed out ...

 nuget.exe locals all -clear 

The next time you start Visual Studio, you should find that everything is working as expected. You may need to uninstall and reinstall the packages so that they all work, but with a cleared cache that should work without problems.

Hope everything is clear.

+21
source share

For the benefit of search engines (since this caused me some disappointment).

I had a similar problem when I moved to a new machine (Windows 10), Nuget (excellent on my old Win10 machine) would break everything except dll.

Decision

  1. Go to the Start menu and enter "Allow application through Windows Firewall"
  2. Click "Change settings," then "Allow another application."
  3. Enter the location (s) of Visual Studio (for example, for VS 2017 - C: \ Program Files (x86) \ Microsoft Visual Studio \ 2017 \ Community \ Common7 \ IDE, then click devenv.exe)
  4. Just to be sure, I checked both private and public networks.
  5. Deleted the package folder
  6. Package restore or rebuild project

This fixed it for me. Hope this helps someone else.

+2
source share

Solved my problem, thank you very much HockeyJ

0
source share

All Articles