Can't start NuGet after first install

Jan 28, 2011 at 1:40 PM

Hi!

I just downloaded the latest version of NuGet and installed it on an XP machine with VS 2010 Ultimate. When I try to add a reference from NuGet, I get the following error message:

 

The composition produced a single composition error, with 2 root causes. The root causes are provided below. Review the CompositionException.Errors property for more detailed information.
1) An item with the same key has already been added.
Resulting in: An exception occurred while trying to create an instance of type 'NuGet.VisualStudio.SolutionManager'.
Resulting in: Cannot activate part 'NuGet.VisualStudio.SolutionManager'.Element: NuGet.VisualStudio.SolutionManager -->  NuGet.VisualStudio.SolutionManager -->  AssemblyCatalog (Assembly="NuGet.VisualStudio, Version=1.0.11220.104, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
Resulting in: Cannot get export 'NuGet.VisualStudio.SolutionManager (ContractName="NuGet.VisualStudio.ISolutionManager")' from part 'NuGet.VisualStudio.SolutionManager'.Element: NuGet.VisualStudio.SolutionManager (ContractName="NuGet.VisualStudio.ISolutionManager") -->  NuGet.VisualStudio.SolutionManager -->  AssemblyCatalog (Assembly="NuGet.VisualStudio, Version=1.0.11220.104, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
Resulting in: Cannot set import 'NuGet.VisualStudio.VsPackageManagerFactory..ctor (Parameter="solutionManager", ContractName="NuGet.VisualStudio.ISolutionManager")' on part 'NuGet.VisualStudio.VsPackageManagerFactory'.Element: NuGet.VisualStudio.VsPackageManagerFactory..ctor (Parameter="solutionManager", ContractName="NuGet.VisualStudio.ISolutionManager") -->  NuGet.VisualStudio.VsPackageManagerFactory -->  AssemblyCatalog (Assembly="NuGet.VisualStudio, Version=1.0.11220.104, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
Resulting in: Cannot get export 'NuGet.VisualStudio.VsPackageManagerFactory (ContractName="NuGet.VisualStudio.IVsPackageManagerFactory")' from part 'NuGet.VisualStudio.VsPackageManagerFactory'.Element: NuGet.VisualStudio.VsPackageManagerFactory (ContractName="NuGet.VisualStudio.IVsPackageManagerFactory") -->  NuGet.VisualStudio.VsPackageManagerFactory -->  AssemblyCatalog (Assembly="NuGet.VisualStudio, Version=1.0.11220.104, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
Resulting in: Cannot set import 'NuGet.Dialog.PackageManagerUI.PackageManagerWindow..ctor (Parameter="packageManagerFactory", ContractName="NuGet.VisualStudio.IVsPackageManagerFactory")' on part 'NuGet.Dialog.PackageManagerUI.PackageManagerWindow'.Element: NuGet.Dialog.PackageManagerUI.PackageManagerWindow..ctor (Parameter="packageManagerFactory", ContractName="NuGet.VisualStudio.IVsPackageManagerFactory") -->  NuGet.Dialog.PackageManagerUI.PackageManagerWindow -->  AssemblyCatalog (Assembly="NuGet.Dialog, Version=1.0.11220.104, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
Resulting in: Cannot get export 'NuGet.Dialog.PackageManagerUI.PackageManagerWindow (ContractName="NuGet.Dialog.PackageManagerUI.PackageManagerWindow")' from part 'NuGet.Dialog.PackageManagerUI.PackageManagerWindow'.Element: NuGet.Dialog.PackageManagerUI.PackageManagerWindow (ContractName="NuGet.Dialog.PackageManagerUI.PackageManagerWindow") -->  NuGet.Dialog.PackageManagerUI.PackageManagerWindow -->  AssemblyCatalog(Assembly="NuGet.Dialog, Version=1.0.11220.104, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
2) Could not finishing composing object of type 'NuGet.VisualStudio.SolutionManager'. The import 'NuGet.VisualStudio.SolutionManager..ctor (Parameter="dte", ContractName="EnvDTE.DTE")' was not satisfied.
Resulting in: Cannot get export 'NuGet.VisualStudio.SolutionManager (ContractName="NuGet.VisualStudio.ISolutionManager")' from part 'NuGet.VisualStudio.SolutionManager'.Element: NuGet.VisualStudio.SolutionManager (ContractName="NuGet.VisualStudio.ISolutionManager") -->  NuGet.VisualStudio.SolutionManager -->  AssemblyCatalog (Assembly="NuGet.VisualStudio, Version=1.0.11220.104, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
Resulting in: Cannot set import 'NuGet.VisualStudio.RepositorySettings..ctor (Parameter="solutionManager", ContractName="NuGet.VisualStudio.ISolutionManager")' on part 'NuGet.VisualStudio.RepositorySettings'.Element: NuGet.VisualStudio.RepositorySettings..ctor (Parameter="solutionManager", ContractName="NuGet.VisualStudio.ISolutionManager") -->  NuGet.VisualStudio.RepositorySettings -->  AssemblyCatalog (Assembly="NuGet.VisualStudio, Version=1.0.11220.104, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
Resulting in: Cannot get export 'NuGet.VisualStudio.RepositorySettings (ContractName="NuGet.VisualStudio.IRepositorySettings")' from part 'NuGet.VisualStudio.RepositorySettings'.Element: NuGet.VisualStudio.RepositorySettings (ContractName="NuGet.VisualStudio.IRepositorySettings") -->  NuGet.VisualStudio.RepositorySettings -->  AssemblyCatalog (Assembly="NuGet.VisualStudio, Version=1.0.11220.104, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
Resulting in: Cannot set import 'NuGet.VisualStudio.VsPackageManagerFactory..ctor (Parameter="repositorySettings", ContractName="NuGet.VisualStudio.IRepositorySettings")' on part 'NuGet.VisualStudio.VsPackageManagerFactory'.Element: NuGet.VisualStudio.VsPackageManagerFactory..ctor (Parameter="repositorySettings", ContractName="NuGet.VisualStudio.IRepositorySettings") -->  NuGet.VisualStudio.VsPackageManagerFactory -->  AssemblyCatalog (Assembly="NuGet.VisualStudio, Version=1.0.11220.104, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
Resulting in: Cannot get export 'NuGet.VisualStudio.VsPackageManagerFactory (ContractName="NuGet.VisualStudio.IVsPackageManagerFactory")' from part 'NuGet.VisualStudio.VsPackageManagerFactory'.Element: NuGet.VisualStudio.VsPackageManagerFactory (ContractName="NuGet.VisualStudio.IVsPackageManagerFactory") -->  NuGet.VisualStudio.VsPackageManagerFactory -->  AssemblyCatalog (Assembly="NuGet.VisualStudio, Version=1.0.11220.104, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
Resulting in: Cannot set import 'NuGet.Dialog.PackageManagerUI.PackageManagerWindow..ctor (Parameter="packageManagerFactory", ContractName="NuGet.VisualStudio.IVsPackageManagerFactory")' on part 'NuGet.Dialog.PackageManagerUI.PackageManagerWindow'.Element: NuGet.Dialog.PackageManagerUI.PackageManagerWindow..ctor (Parameter="packageManagerFactory", ContractName="NuGet.VisualStudio.IVsPackageManagerFactory") -->  NuGet.Dialog.PackageManagerUI.PackageManagerWindow -->  AssemblyCatalog (Assembly="NuGet.Dialog, Version=1.0.11220.104, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
Resulting in: Cannot get export 'NuGet.Dialog.PackageManagerUI.PackageManagerWindow (ContractName="NuGet.Dialog.PackageManagerUI.PackageManagerWindow")' from part 'NuGet.Dialog.PackageManagerUI.PackageManagerWindow'.Element: NuGet.Dialog.PackageManagerUI.PackageManagerWindow (ContractName="NuGet.Dialog.PackageManagerUI.PackageManagerWindow") -->  NuGet.Dialog.PackageManagerUI.PackageManagerWindow -->  AssemblyCatalog(Assembly="NuGet.Dialog, Version=1.0.11220.104, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")

 

If I try to use the console, Visual Studio crashes... Any ideas anyone?

Jan 28, 2011 at 2:17 PM
When you say latest version, where do you get it from? This is a known issue in windows xp because it does not have the powershell 2.0 runtime that nuget requires. If you install ps runtime it will work.

In the latest build on our CI machine we have fixed it by displaying a friendly error message. Please try it out and let us know if it works.
>
Jan 31, 2011 at 10:38 AM

Thanks for the tip - that worked... Sort of... I first tried on a new project, and I was able to use the NuGet GUI. Then I opened an existing project, and tried again. This time I got the following error: 

The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.
1) An item with the same key has already been added.
Resulting in: An exception occurred while trying to create an instance of type 'NuGet.Dialog.PackageManagerUI.PackageManagerWindow'.
Resulting in: Cannot activate part 'NuGet.Dialog.PackageManagerUI.PackageManagerWindow'.Element: NuGet.Dialog.PackageManagerUI.PackageManagerWindow -->  NuGet.Dialog.PackageManagerUI.PackageManagerWindow -->  AssemblyCatalog (Assembly="NuGet.Dialog, Version=1.0.11220.104, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
Resulting in: Cannot get export 'NuGet.Dialog.PackageManagerUI.PackageManagerWindow (ContractName="NuGet.Dialog.PackageManagerUI.PackageManagerWindow")' from part 'NuGet.Dialog.PackageManagerUI.PackageManagerWindow'.Element: NuGet.Dialog.PackageManagerUI.PackageManagerWindow (ContractName="NuGet.Dialog.PackageManagerUI.PackageManagerWindow") -->  NuGet.Dialog.PackageManagerUI.PackageManagerWindow -->  AssemblyCatalog (Assembly="NuGet.Dialog, Version=1.0.11220.104, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")

At first it looks like the same as the first error I got earlier, but it references other parts of the code... Any ideas?