2012-03-24 73 views
8

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

以下是错误试图从VS扩展管理器安装它时,我得到:

该系统找不到指定的路径。 (异常来自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) 
+0

哪些额外的信息,您可以在'%TEMP参见%\ VSIXInstaller_ .log'? – Oleg 2012-03-24 14:03:00

+0

@Oleg - 我将日志文件转储到问题 – leora 2012-03-24 14:09:41

回答

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

尝试设置你的环境变量PATH在我的电脑的系统属性>高级选项卡

0

我的唯一的事情了解NuGet在“我的文档”下的安装如下:

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

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

你能检查这些文件夹是否存在吗?

只是一个理论,但如果不是,也许你可以自己创建这些文件夹,然后重试安装?

9

我正面临类似的问题,关于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扩展
    • 至少对我来说,这一切都发生smoo thly恰好之前
  7. 退出的Visual Studio
  8. 还原的Personal注册表值恢复到以前的状态
  9. 重新启动Visual Studio
    • ...等voil&agrave这是没有发生的样子; !
+3

+1这是***解决方案 – jgauffin 2013-02-11 07:38:34

+0

同意,这的确是解决方案。干得好,这个工作令人惊讶。有一些迹象表明,这与VSIXInstaller.exe有关,而不是NuGet Package Manager。问题是,出于某种原因,VSIXInstaller正在查找您的Personal \ MyDocuments文件夹,并且如果它通常映射到网络驱动器,并且它当前未映射,它将失败。这是一个可引用的codeplex问题。 https://nuget.codeplex.com/workitem/700 – 2013-08-16 21:49:28

+0

Oleg的解决方案非常简单,只需将它添加到配置/运行时下的devenv.exe.config即可: dperish 2014-11-12 20:02:40

0

如果您重定向文件夹....然后事情是borked。

解决方法:

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

再次运行你的东西。

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

相关问题