2011-04-08 24 views
12

Tengo un problema similar al del reflector, excepto que no tengo instalado el complemento Reflector, y todavía no puedo iniciar la consola NuGet. Estoy corriendo en Windows 7 Professional, VS 2010 SP1.NuGet no puede cargar PowerShell

Nuget funciona bien a través de la GUI, pero, por ejemplo, no puedo instalar archivos * .vsdoc sin la consola.

El siguiente error es:

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) 
+0

Ver respuestas en preguntas relacionadas: http://stackoverflow.com/questions/10457039/nuget-powershell-and-executionpolicy –

Respuesta

8

La única solución que funcionó fue iniciar PowerShell manualmente antes de iniciar VS2010.

Si alguien tuvo este problema, esa es la solución rápida.

+0

"característica" increíblemente molesta de powershell. Tengo la política establecida en "Omitir" en el alcance de "LocalMachine", sin embargo, estaba viendo esto. Ejecutar PS antes VS hizo el truco, thx para guardar mi día – galaktor

2

NuGet necesita Powershell2 para que funcione correctamente. Puede descargar e instalar si desde aquí: http://support.microsoft.com/kb/968929

+0

Además sin tener el poder 2, asegúrese de estar usando la última versión de NuGet http://nuget.org/. – davidfowl

+0

Sí, pero el mensaje de error está extrayendo del directorio de powershell 1.0 :) –

+0

El mensaje de error en las versiones> 1.0 indica exactamente qué está mal :). – davidfowl

0

Iniciar el powershell no me sirve. Descubrí que este es un problema conocido de Nuget. Obtiene este problema porque tiene el complemento reflector de compuerta roja instalado y habilitado. Si actualiza Reflector a la última versión (> = 6.5), debería funcionar.

favor, eche un vistazo a este enlace

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

+0

No se instaló el complemento Reflector. Ese fue el problema inicial. :RE – Drakche

0

tuve este problema en Visual Studio 2012. Ni la eliminación del reflector ni la eliminación de extensión GhostDoc, que tanto se dice que causa este tipo de errores, ayudado. Sin embargo, la instalación de Windows Powershell 3.0 vino al rescate: http://technet.microsoft.com/en-us/library/jj205328.aspx

0

Herramientas de potencia de productividad era mi problema. v12.0.30129.0 Lo deshabilité - no fue necesaria una desinstalación - y frente a 2013 funcionó de nuevo

Cuestiones relacionadas