How to reinstall a nuget package that is already in the solution packages directory?

Background / History

  • I have a solution containing an MVC4 project.
  • I downloaded the nuget package (specifically the dotLess package). This has added the packages folder to my solution directory, which includes countless (it's still there).
  • Then I deleted the MVC4 project to start a new one, and added a new project with the same name.

Usually I just reinstall the package. However, this seems to require a Nuget server and an Internet connection. This is great, except that my development machine currently does not have internet.

Question

Since I can see the folder with the package file in my "packages" directory, is there any way to add it to the project without having to travel around the world over the Internet?

+4
source share
4 answers

Another option is to configure the local nuget gallery for your offline access to packages

http://www.codecapers.com/post/How-to-Set-Up-a-Local-NuGet-Gallery.aspx

+2
source

Have you tried this with Scott Hanselman? http://www.hanselman.com/blog/HowToAccessNuGetWhenNuGetorgIsDownOrYoureOnAPlane.aspx

In short, he suggests that since NuGet caches stuff on the local hard drive, you have to tell it to point there.

I used this when the proxy prevented me from connecting to the Internet and it worked fine!

+1
source

If you understand correctly and know the correct version number, you can try adding the following to package.config and see if it went up correctly.

<package id="dotless" version="1.3.1.0" /> 
-1
source

This may not be the ideal answer, but whenever I lose touch with the Nuget package in Visual Studio, I usually go to the Nuget console and reinstall from there, after which all connections are restored. Which in your case would be something like:

PM> Install-package without dots

In any case, perhaps I do not understand your problem;) Hello!

-1
source

All Articles