VSIP Package Integration

Topics: General
Jun 3, 2013 at 10:55 AM
Hi - I maintain a (very old C++) VSIP package which adds a new project type and language to VS and am at last working on Visual Studio 2012 integration. Things are working generally OK with the exception of NuGet.

If I open VS, then a project of my type, then try to do something with NuGet like Tools->Library Package Manager->Package Manager Console then I get the message that NuGet has failed to load.

If I check the activity log I see many messages along the lines of:

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'.

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

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

Resulting in: Cannot set import 'NuGet.VisualStudio.PackageRestoreManager..ctor (Parameter="solutionManager", ContractName="NuGet.VisualStudio.ISolutionManager")' on part 'NuGet.VisualStudio.PackageRestoreManager'.
Element: NuGet.VisualStudio.PackageRestoreManager..ctor (Parameter="solutionManager", ContractName="NuGet.VisualStudio.ISolutionManager") --> NuGet.VisualStudio.PackageRestoreManager

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

If however I load NuGet from a fresh start of VS, but then load a project of my type after loading NuGet - things work correctly (NuGet cannot be used to add references with my project type, but thats not an issue - at least it does not fail to load).

I'm assuming that there is some VS interface method implementation that I am returning E_NOTIMPL from which is causing this, but putting breakpoints of every single E_NOTIMPL in my package code does not help with this.

Before I set off debugging NuGet along with my package, I was wondering if anyone could give any possible pointers as to what my package is (or it not) doing to cause this.

Many thanks.
Jun 3, 2013 at 11:58 PM
NuGet does query many properties from the project, so I can't think of any particular one that may cause the exception. I think you have to debug NuGet. Sorry about that.