【问题标题】:NuGet fails to load PowerShellNuGet 无法加载 PowerShell
【发布时间】:2015-10-28 19:11:28
【问题描述】:

我有一个类似reflector问题的问题,只是我没有安装Reflector插件,还是无法启动NuGet控制台。我在 Windows 7 Professional VS 2010 SP1 上运行。

Nuget 通过 GUI 可以正常工作,但例如,我无法在没有控制台的情况下安装 *.vsdoc 文件。

以下错误是:

The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(2943) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: Cannot convert the "Microsoft.PowerShell.Commands.SecurityDescriptorCommandsBase" value of type "System.String" to type "System.Type".
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(2950) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: Cannot convert the "Microsoft.PowerShell.Commands.SecurityDescriptorCommandsBase" value of type "System.String" to type "System.Type".
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(2957) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: Cannot convert the "Microsoft.PowerShell.Commands.SecurityDescriptorCommandsBase" value of type "System.String" to type "System.Type".
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(2964) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: Cannot convert the "Microsoft.PowerShell.Commands.SecurityDescriptorCommandsBase" value of type "System.String" to type "System.Type".
The following error occurred while loading the extended type data file: Microsoft.PowerShell.Core, C:\Windows\SysWOW64\WindowsPowerShell\v1.0\types.ps1xml(2971) : Error in type "System.Security.AccessControl.ObjectSecurity": Exception: Cannot convert the "Microsoft.PowerShell.Commands.SecurityDescriptorCommandsBase" value of type "System.String" to type "System.Type".
The following error occurred while loading the extended type data file: , C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft Corporation\NuGet Package Manager\1.2.20325.9034\Scripts\NuGet.Types.ps1xml(9) : Error in type "System.__ComObject#{866311e6-c887-4143-9833-645f5b93f6f1}": Exception: Cannot convert the "NuGet.VisualStudio.ProjectExtensions" value of type "System.String" to type "System.Type".
The following error occurred while loading the extended type data file: , C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft Corporation\NuGet Package Manager\1.2.20325.9034\Scripts\NuGet.Types.ps1xml(33) : Error in type "Microsoft.VisualStudio.FSharp.ProjectSystem.Automation.OAProject": Exception: Cannot convert the "NuGet.VisualStudio.ProjectExtensions" value of type "System.String" to type "System.Type".
System.Management.Automation.CmdletInvocationException: Could not load file or assembly 'Scripts\nuget.psm1' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)) ---> System.IO.FileLoadException: Could not load file or assembly 'Scripts\nuget.psm1' or one of its dependencies. The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG)) ---> System.ArgumentException: Illegal characters in path.
at System.IO.Path.CheckInvalidPathChars(String path)
at System.IO.Path.Combine(String path1, String path2)
at Microsoft.VisualStudio.Platform.VsAppDomainManager.<AssemblyPaths>d__1.MoveNext()
at Microsoft.VisualStudio.Platform.VsAppDomainManager.InnerResolveHandler(String name)
at Microsoft.VisualStudio.Platform.VsAppDomainManager.ResolveHandler(Object sender, ResolveEventArgs args)
at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)
--- End of inner exception stack trace ---
at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadBinaryModule(Boolean trySnapInName, String moduleName, String fileName, Assembly assemblyToLoad, String moduleBase, SessionState ss, String prefix, Boolean loadTypes, Boolean loadFormats, Boolean& found)
at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadModuleNamedInManifest(String moduleName, String moduleBase, Boolean searchModulePath, String prefix, SessionState ss, Boolean loadTypesFiles, Boolean loadFormatFiles, Boolean& found)
at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadModuleManifest(ExternalScriptInfo scriptInfo, ManifestProcessingFlags manifestProcessingFlags, Version version)
at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadModule(String fileName, String moduleBase, String prefix, SessionState ss, Boolean& found)
at Microsoft.PowerShell.Commands.ImportModuleCommand.ProcessRecord()
at System.Management.Automation.Cmdlet.DoProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()
--- End of inner exception stack trace ---
at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
at System.Management.Automation.Runspaces.Pipeline.Invoke()
at NuGetConsole.Host.PowerShell.Implementation.PowerShellHost.Invoke(String command, Object input, Boolean outputResults)
at NuGetConsole.Host.PowerShell.Implementation.PowerShellHostExtensions.ImportModule(PowerShellHost host, String modulePath)
at NuGetConsole.Host.PowerShell.Implementation.PowerShellHost.LoadStartupScripts()
at NuGetConsole.Host.PowerShell.Implementation.PowerShellHost.Initialize()
at NuGetConsole.Implementation.Console.ConsoleDispatcher.Start()
at NuGetConsole.Implementation.PowerConsoleToolWindow.MoveFocus(FrameworkElement consolePane)

【问题讨论】:

标签: visual-studio-2010 powershell nuget


【解决方案1】:

唯一可行的解​​决方案是在启动 VS2010 之前手动启动 PowerShell。

所以如果有人遇到这个问题,那就是快速解决。

【讨论】:

  • powershell 令人难以置信的烦人“功能”。我在“LocalMachine”范围内将策略设置为“绕过”,但我看到了这一点。在 VS 之前运行 PS 就成功了,感谢您节省了我的一天
【解决方案2】:

NuGet 需要 Powershell2 才能正常工作。你可以从这里下载安装:http://support.microsoft.com/kb/968929

【讨论】:

  • 除了没有 powershell 2 之外,请确保您使用的是最新版本的 NuGet nuget.org
  • 是的,但是错误消息是从 powershell 1.0 目录中提取的 :)
  • 版本 > 1.0 中的错误消息告诉你到底出了什么问题:)。
  • 我已经准备好安装powershell 2.0及其最新版本的nuget。这些是我尝试过的第一件事。
  • 尝试禁用所有加载项。工具 -> 加载项管理器。看看它是否加载。
【解决方案3】:

启动 powershell 对我没有帮助。我发现这是 Nuget 的一个已知问题。您遇到此问题是因为您安装并启用了红色门反射器插件。如果您将 Reflector 更新到最新版本 (>= 6.5),它应该可以工作。

请看这个链接

http://nuget.codeplex.com/workitem/265

【讨论】:

  • 没有安装反射器插件。那是最初的问题。 :D
【解决方案4】:

我在 Visual Studio 2012 下遇到了这个问题。删除 Reflector 和删除 GhostDoc 扩展(据说都会导致此类错误)都没有帮助。然而,安装 Windows Powershell 3.0 来拯救: http://technet.microsoft.com/en-us/library/jj205328.aspx

【讨论】:

    【解决方案5】:

    生产力电动工具是我的问题。 v12.0.30129.0 我禁用了它 - 不需要卸载 - 并且 vs 2013 再次工作

    【讨论】:

      猜你喜欢
      • 2012-12-19
      • 2013-06-05
      • 1970-01-01
      • 1970-01-01
      • 2017-09-22
      • 1970-01-01
      • 1970-01-01
      • 2019-04-13
      • 1970-01-01
      相关资源
      最近更新 更多