如果我的文档文件夹在共享驱动器上,我可以安装/使用nuget吗?

时间:2012-03-24 12:04:35

标签: visual-studio-2010 nuget

如果您的“我的文档”文件夹位于共享驱动器上,我在nuget论坛上看到number of issues无法安装。如果我没有灵活性来改变这个(锁定政策)有什么方法可以使用nuget吗?

以下是尝试从VS Extension Manager安装时出现的错误:

系统找不到指定的路径。 (HRESULT的例外情况:

enter image description here

VS日志文件显示:

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)

5 个答案:

答案 0 :(得分:10)

我遇到了类似的问题,关于CasPolloadFromRemoteSources的各种建议都失败了;这对我有用(在Windows 7 sp1上):

  1. 卸载当前的NuGet扩展
  2. 关闭Visual Studio
  3. 打开注册表编辑器并导航至HKEY_CURRENT-USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\
    • Personal键会将共享文件夹显示为其值
  4. 将该值修改为本地驱动器位置,例如C:\Temp\
    • 请不要关闭regedit,因为您将在稍后更改它
  5. 打开Visual Studio
    • 它可能会抱怨找不到某些设置,但我只是点击了警告
  6. 安装NuGet扩展程序
    • 至少对我来说,这一切都顺利完成了
    • 之前没有发生的事情
  7. 退出Visual Studio
  8. Personal注册表值还原为以前的状态
  9. 重新启动Visual Studio
    • ...etvoilà!

答案 1 :(得分:3)

我自己没有对此进行测试,但您可以尝试修改C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.config文件并添加loadFromRemoteSources元素:

<loadFromRemoteSources enabled="true"/>

位置<configuration> \ <runtime>。此外,您可以尝试验证没有安装其他旧版本的NuGet。您应该使用上下文菜单启动Visual Studio 2010快捷方式,然后选择“以管理员身份运行”以确保您可以将其卸载。

此外,您可以考虑将“FullTrust”添加到.NET的共享

CasPol.exe -m -ag 1.2 -url file://ServerName/ShareName/* FullTrust

答案 2 :(得分:2)

尝试在MyComputer的系统属性中设置环境变量路径&gt;高级选项卡

答案 3 :(得分:0)

我知道NuGet在“我的文档”下安装的唯一内容如下:

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

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

你能检查一下这些文件夹吗?

只是一个理论,但如果没有,也许您可​​以自己创建这些文件夹并重试安装?

答案 4 :(得分:0)

如果您有重定向文件夹....那么就会出现问题。

解决方法:

选择菜单开始所有程序附件,右键单击命令提示符,然后选择以管理员身份运行。输入subst Z: "C:\Windows"并按输入(Z是重定向的文件夹路径)。

再次运行你的东西。

“修复”:http://support.microsoft.com/kb/886549