SeanKilleen
SeanKilleen

Reputation: 8977

How to re-install nuget package that's already in the solution's packages directory?

Background / History

Normally, I would just reinstall the package. However, this seems to require the Nuget server and a connection to the internet. This is fine, except currently my development machine is without internet.

Question

Since I can see the folder with the package file in my solution's "packages" directory, is there any way I can add it to the project without having to round-trip via the internet?

Upvotes: 4

Views: 1411

Answers (4)

gardarvalur
gardarvalur

Reputation: 1585

This is perhaps not an ideal answer but whenever I loose connection with a Nuget package in Visual Studio I usually turn to the Nuget Console and reinstall from there, after that all connections are restored. Which in your case would be something like:

PM> Install-Package dotless

Anyway, maybe I´m misunderstanding your issue ;) Regards!

Upvotes: -1

Iain
Iain

Reputation: 166

Another option would be to setup a local nuget gallery for your offline access to the packages

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

Upvotes: 2

Tom Chantler
Tom Chantler

Reputation: 14931

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

In brief he suggests that since NuGet caches stuff on your local hard drive, you should tell it to point there.

I used this when a proxy was preventing me from connecting to the internet and it worked nicely!

Upvotes: 1

dove
dove

Reputation: 20674

If I understand you correctly and you know the correct version number then you could try adding the following to packages.config and see if it's picked up correctly.

  <package id="dotless" version="1.3.1.0" />

Upvotes: -1

Related Questions