Friday 12 August 2011

Manage Nuget Packages error

I suddenly started getting a weird error when trying to open the Nuget package manager (by right clicking the project in VS Solution Explorer and selecting the Manage Nuget Packages option). A dialogue appears containing the following error message and stack trace:

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) Not implemented (Exception from HRESULT: 0x80004001 (E_NOTIMPL))

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



It turns out this is a known problem if your solution contains an Installshield LE Setup project.

http://docs.nuget.org/docs/reference/known-issues

The workaround is to temporarily unload all Installshield LE setup projects in the solution. The Nuget package manager should now open correctly. Alternatively, if you close the solution, open a solution that does not contain any Installshield LE setup projects, open the Nuget package manager, then go back to the original solution, Nuget will open fine without unloading the setup projects.