Can i install / use nuget if my documents folder is on a shared drive?

8

I see a number of issues on the nuget forum around not being able to install if your My documents folder is on a shared drive. If I don't have the flexibility to change this (locked down policy) is there any way i can use nuget?

Here is the error i get when trying to install it from the VS Extension Manager:

The system cannot find the path specified. (Exception from HRESULT:

enter image description here

The VS log file shows:

3/23/2012 9:45:26 PM - Microsoft Visual Studio Extension Installer
3/23/2012 9:45:26 PM - -------------------------------------------
3/23/2012 9:45:26 PM - Initializing Install...
3/23/2012 9:45:26 PM - Extension Details...
3/23/2012 9:45:26 PM -  Identifier      : NuPackToolsVsix.Microsoft.67e54e40-0ae3-42c5-a949-fddf5739e7a5
3/23/2012 9:45:26 PM -  Name            : NuGet Package Manager
3/23/2012 9:45:26 PM -  Author          : Microsoft Corporation
3/23/2012 9:45:26 PM -  Version         : 1.6.21215.9133
3/23/2012 9:45:26 PM -  Description     : A collection of tools to automate the process of downloading, installing, upgrading, configuring, and removing packages from a VS Project.
3/23/2012 9:45:26 PM -  Locale          : en-US
3/23/2012 9:45:26 PM -  MoreInfoURL     : http://docs.nuget.org/
3/23/2012 9:45:26 PM -  InstalledByMSI  : False
3/23/2012 9:45:26 PM -  MinFramework    : 4.0
3/23/2012 9:45:26 PM -  MaxFramework    : 4.0
3/23/2012 9:45:26 PM - 
3/23/2012 9:45:26 PM -  Supported Visual Studio Editions : 
3/23/2012 9:45:26 PM -      Version : 10.0
3/23/2012 9:45:26 PM -          Pro
3/23/2012 9:45:26 PM -          IntegratedShell
3/23/2012 9:45:26 PM -          VWDExpress
3/23/2012 9:45:26 PM -          VPDExpress
3/23/2012 9:45:26 PM -      Version : 11.0
3/23/2012 9:45:26 PM -          Pro
3/23/2012 9:45:26 PM -          IntegratedShell
3/23/2012 9:45:26 PM -          VWDExpress
3/23/2012 9:45:26 PM -          VPDExpress
3/23/2012 9:45:26 PM - 
3/23/2012 9:45:26 PM -  Supported Isolated Shells : 
3/23/2012 9:45:26 PM - 
3/23/2012 9:45:26 PM -  References      : 
3/23/2012 9:45:26 PM - 
3/23/2012 9:45:26 PM - System.IO.DirectoryNotFoundException: The system cannot find the path specified. (Exception from HRESULT: 0x80070003)
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at Microsoft.VisualStudio.Settings.ExternalSettingsManager.GetScopePaths(String applicationPath, String suffixOrName, Boolean isLogged, Boolean isForIsolatedApplication)
   at Microsoft.VisualStudio.Settings.ExternalSettingsManager.CreateForApplication(String applicationPath)
   at VSIXInstaller.App.GetExtensionManager(SupportedVSSKU sku)
   at VSIXInstaller.App.GetExtensionManagerForApplicableSKU(SupportedVSSKU supportedSKU, IInstallableExtension installableExtension, List`1 applicableSKUs)
   at VSIXInstaller.App.InitializeInstall()
   at VSIXInstaller.App.OnStartup(StartupEventArgs e)
visual-studio-2010
nuget
asked on Stack Overflow Mar 24, 2012 by leora • edited Jul 28, 2012 by Jim Counts

5 Answers

10

I was facing a similar issue and the various suggestions about CasPol and loadFromRemoteSources failed; here's what worked for me (on Windows 7 sp1):

  1. Uninstall the current NuGet extension
  2. Close Visual Studio
  3. Open up a registry editor and navigate to HKEY_CURRENT-USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\
    • The Personal key will show the shared folder as its value
  4. Amend that value to a local drive location, e.g. C:\Temp\
    • Don't close regedit as you'll be changing it back in a moment
  5. Open Visual Studio
    • it might complain about not finding certain settings, but I just clicked through the warnings
  6. Install the NuGet extension
    • at least for me, this all happened smoothly in exactly the way that wasn't happening before
  7. Quit Visual Studio
  8. Revert the Personal registry value back to its previous state
  9. Restart Visual Studio
    • ... et voilà!
answered on Stack Overflow Oct 26, 2012 by Unsliced
3

I don't tested this myself, but you can try to modify C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.config file and include loadFromRemoteSources element:

<loadFromRemoteSources enabled="true"/>

at the location <configuration> \ <runtime>. Additionally you can try to verify that no other old version NuGet is installed. You should start Visual Studio 2010 shortcut with context menu and choose "Run as administrator" to be sure that you can uninstall it.

Additionally you can consider to add "FullTrust" to the share for the .NET

CasPol.exe -m -ag 1.2 -url file://ServerName/ShareName/* FullTrust
answered on Stack Overflow Mar 24, 2012 by Oleg
2

Try to set your Environment Variable Path in the MyComputer's System Properties > Advance tab

answered on Stack Overflow Jul 6, 2012 by SoftBuilders Pk
0

The only thing I know NuGet installs under "My Documents" is the following:

%LocalAppData\NuGet <-- here you usually find the default cache folder

%AppData\NuGet <-- here you find the machine-level nuget.config file

Can you check if these folders are there?

Just a theory, but if not, maybe you can create those folders yourself and retry the installation?

answered on Stack Overflow Jul 30, 2012 by Xavier Decoster
0

If you have redirected folders.... then something is borked.

Workaround:

Choose menu StartAll ProgramsAccessories, right-click on Command Prompt, and choose Run As Administrator. Type subst Z: "C:\Windows" and press Enter (Z is your redirected folder path).

Run your stuff again.

The "fix": http://support.microsoft.com/kb/886549

answered on Stack Overflow Feb 19, 2014 by Kelly Davis • edited Dec 10, 2017 by Peter Mortensen

User contributions licensed under CC BY-SA 3.0