Showing posts with label Nuget. Show all posts
Showing posts with label Nuget. Show all posts

Tuesday, October 7, 2014

Install NuGet Packages Offline - Visual Studio

Problem:
You are offline and trying to create a VS project with NuGet Package dependencies.
The challenge is how to get them.

Solution:

Use the cached copies on your machine stored at, %LOCALAPPDATA%\NuGet\Cache.

1.) Start Visual Studio and Open the package manager
  • Tools > NuGet Package Manager > Package Manager Settings
  • Select Package Sources in left hand menu
2.) Add Cache package to package manager.
  • Above the Available Package Sources window are 4 icons
  • Select the + and this will add a new source
  • Highlight the new entry
  • Edit the Name field, provide a name of your choosing
  • Source field add full path to the NuGet Cache
    • Find it by opening a  windows explorer window and typing the path, %LOCALAPPDATA%\NuGet\Cache
    • This will resolve to the path to your local cache
  • Select Update
3.) Your Done.

WARNING: Realize that this is only valid until you clear your nuget cache.

Source:
http://nuget-offline.blogspot.com/#!

Monday, October 6, 2014

NuGet Error in Visual Studio - Specified path, file name or both are too long. 260 vs. 248

Trying to update some NuGet packages and had the package refuse to deploy giving this message:

The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
Solution:
Turns out that Visual Studio 2012 has a fixed limit length on property paths of 248 characters.
My package length was 260 characters.  The fix is to not nest your project so deep, ie. shorter paths!!

Microsoft know about the issue:

Hello everyone and thank you for the feedback and for voting on this issue. We understand that this can be a frustrating issue, however, fixing it requires a large and complicated architectural change across different products and features including Visual Studio, TFS, MSBuild and the .NET Framework. Dedicating resources to this work item would come at the expense of many other features and innovation. Additionally, if we removed this limitation from our first party tools it will still likely exist elsewhere in Visual Studio’s ecosystem of extensions and tools. For these reasons, we are declining this suggestion and returning return everyone’s votes so they can be applied to other items. In the interest of delivering the most value to our customers we sometimes have to make very difficult cuts, and this is one of them.
Thank you,
Will Buik,
Visual Studio – Project and Build Team


Source:
http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2156195-fix-260-character-file-name-length-limitation