Not Working: "Initializing Powershell Host: CompositionException"

Nov 12, 2011 at 11:08 PM

Hi, I've been trying to get NuGet working but to no avail (Windows 7 Ultimate 64bit, Visual Studio Professional) : "Initializing PowerShell Host" is shown, when I scroll up in the Package Manager Console, I get an exception message.  Is there a problem with one of my packages?  I'm not sure where to look.  Thanks!

System.ComponentModel.Composition.CompositionException: The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.

1) '.', hexadecimal value 0x00, is an invalid character. Line 1, position 1.

Resulting in: The type initializer for 'NuGet.Settings' threw an exception.

Resulting in: An exception occurred while trying to create an instance of type 'NuGet.VisualStudio.VsPackageSourceProvider'.

Resulting in: Cannot activate part 'NuGet.VisualStudio.VsPackageSourceProvider'.
Element: NuGet.VisualStudio.VsPackageSourceProvider -->  NuGet.VisualStudio.VsPackageSourceProvider

Resulting in: Cannot get export 'NuGet.VisualStudio.VsPackageSourceProvider (ContractName="NuGet.VisualStudio.IVsPackageSourceProvider")' from part 'NuGet.VisualStudio.VsPackageSourceProvider'.
Element: NuGet.VisualStudio.VsPackageSourceProvider (ContractName="NuGet.VisualStudio.IVsPackageSourceProvider") -->  NuGet.VisualStudio.VsPackageSourceProvider

   at System.ComponentModel.Composition.Hosting.CompositionServices.GetExportedValueFromComposedPart(ImportEngine engine, ComposablePart part, ExportDefinition definition)
   at System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportedValue(ComposablePart part, ExportDefinition export, Boolean isSharedPart)
   at System.ComponentModel.Composition.Hosting.CatalogExportProvider.CatalogExport.GetExportedValueCore()
   at System.ComponentModel.Composition.Primitives.Export.get_Value()
   at System.ComponentModel.Composition.ExportServices.GetExportedValueFromLazy[T](Export export)
   at System.ComponentModel.Composition.Hosting.ExportProvider.GetExportedValueCore[T](String contractName, ImportCardinality cardinality)
   at System.ComponentModel.Composition.Hosting.ExportProvider.GetExportedValue[T](String contractName)
   at System.ComponentModel.Composition.Hosting.ExportProvider.GetExportedValue[T]()
   at Microsoft.VisualStudio.ComponentModelHost.ComponentModel.GetService[T]()
   at NuGet.VisualStudio.ServiceLocator.GetComponentModelService[TService]()
   at NuGet.VisualStudio.ServiceLocator.GetInstance[TService]()
   at NuGetConsole.Host.PowerShell.Implementation.PowerShellHost..ctor(String name, IRunspaceManager runspaceManager)
   at NuGetConsole.Host.PowerShell.Implementation.PowerShellHostService.CreateHost(String name, Boolean isAsync)
   at NuGetConsole.Host.PowerShellProvider.PowerShellHostProvider.CreatePowerShellHost(Boolean async)
   at NuGetConsole.Host.PowerShellProvider.PowerShellHostProvider.CreateHost(Boolean async)
   at NuGetConsole.Implementation.PowerConsole.HostInfo.get_WpfConsole()
   at NuGetConsole.Implementation.PowerConsoleToolWindow.get_WpfConsole()

Nov 13, 2011 at 2:25 PM

Can you share the file %appdata%\nuget\nuget.config on your machine?