MEF resolution errors making Nuget completely unusable

Dec 28, 2010 at 7:20 PM
Edited Dec 28, 2010 at 7:21 PM

I opened work item 501 I am experiencing extreme issues with Nuget that leave it completely unusable, looking at the error message in depth it says Assembly NuGet.VisualStudio, Version=1.0.11220.104 this is absolutely alien to me since the published binaries are for 11217.102 which appears to be less than what the error dialog shows. When I look in the extension manager I see that the version installed according to Visual Studio is indeed 11217.102 same as here on codeplex.

I have absolutely no idea what this could be from, this started occurring some point after upgrading to MVC3 RC2. I've tried countless times to uninstall MVC3 and Nuget and reinstall them and nothing ever seems to work. I've done system wide searches for any possible nuget binaries and have removed every instance of them and then installed nuget both straight from here and through the extension manager nothing ever comes out with a working tool.

This is severely impacting my work now since I've developed software that will be used site wide in numerous projects that i really wanted to publish internally based on nuget so when invariable bug fixes occur that I don't have to manually deploy them through every solution but as of now it seems entirely impossible to do with Nuget.

Dec 28, 2010 at 7:50 PM
Edited Dec 28, 2010 at 7:51 PM

I'm sorry to hear that NuGet is not working for you. We're trying to repro it internally. Meanwhile, can you try these steps:

  • Open the folder: %Program Files%\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Outercurve Foundation\NuGet Package Manager\<version>\ and check the versions of all the assemblies in there. What are the version?
  • Check the GAC, "gacutil.exe /l" and see if there is any NuGet assemblies left in there? If yes, what are the versions?

For convenience, NuGet assemblies are:

NuGet.Console.dll

NuGet.Core.dll

NuGet.Dialog.dll

NuGet.TeamFoundationServer.dll

NuGet.Tools.dll

NuGet.VisualStudio.dll

NuGetConsole.Host.PowerShell.dll

NuGetConsole.Host.PowerShellProvider.dll

Dec 28, 2010 at 8:12 PM

 

dotnetjunky wrote:

I'm sorry to hear that NuGet is not working for you. We're trying to repro it internally. Meanwhile, can you try these steps:

  • Open the folder: %Program Files%\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Outercurve Foundation\NuGet Package Manager\<version>\ and check the versions of all the assemblies in there. What are the version?

When you said Outercurve Foundation did you mean Microsoft Corporation folder?

In C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft Corporation\NuGet Package Manager there is a single folder of 1.0.11217.102

Inside the folder for 1.0.11217.102 I see that Product Version / File Version for NuGet.Core.dll is 1.0.11220.104 all of the binaries in this folder appear to be the same version as core

dotnetjunky wrote:
  • Check the GAC, "gacutil.exe /l" and see if there is any NuGet assemblies left in there? If yes, what are the versions?

 

There does not appear to be a single reference of NuGet inside the GAC in any form, you can view my full output of gacutil /l at : http://pastebin.com/5s8TVYEz

Dec 28, 2010 at 8:13 PM

Since the version # of the folder and the version # of the assemblies are mismatched is it possible that some kind of manifest etc is incorrect? Or that the build process is off that it's linking newer code to an older manifest that it shouldn't be? or some other similar concept?

Should I try renaming the <version> folder to match the file version of the binaries?

Dec 28, 2010 at 8:30 PM

With more digging I see in NuGet.Tools.pkgdef at line 8:

="NuGet.Tools.NuGetPackage, NuGet.Tools, Version=1.0.11217.102, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"

Which shows a very hard version link to the assemblies which clearly doesn't match what exists on my machine. This is really making me think the build/package process is introducing this error somehow since the binaries don't match package definitions.

Developer
Dec 28, 2010 at 8:43 PM
Edited Dec 28, 2010 at 8:56 PM

This error happens when there are multiple copies of nuget in VS's probing paths. It loads all of the assemblies and mef tries to import an interface and ends up getting more than one (I think :)). Try these steps:

  1. Uninstall NuGet
  2. Scan the machine and make sure there are no binaries in the following places
    The GAC (use gacutil /l like dotnetjunky said)
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
    %localappdata%Microsoft\VisualStudio\10.0\Extensions\Outercurve Foundation
    %localappdata%Microsoft\VisualStudio\10.0\Extensions\Microsoft Corporation
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft Corporation
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Outercurve Foundation
  3. If nuget is at any of the above locations then delete the folder
  4. Re-install nuget
Dec 28, 2010 at 10:07 PM
dfowler wrote:

This error happens when there are multiple copies of nuget in VS's probing paths. It loads all of the assemblies and mef tries to import an interface and ends up getting more than one (I think :)). Try these steps:

  1. Uninstall NuGet
  2. Scan the machine and make sure there are no binaries in the following places
    The GAC (use gacutil /l like dotnetjunky said)
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
    %localappdata%Microsoft\VisualStudio\10.0\Extensions\Outercurve Foundation
    %localappdata%Microsoft\VisualStudio\10.0\Extensions\Microsoft Corporation
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft Corporation
    C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Outercurve Foundation
  3. If nuget is at any of the above locations then delete the folder
  4. Re-install nuget

I verified that every single location listed was purged of all facets of Nuget, i then pulled up regedit and purged every single key in my entire registry hive that contained nuget. Reinstalled nuget and get the exact same error.

 

I guess at this point I have nothing else left to do except uninstall all of visual studio. If that doesn't work I guess I need to nuke my entire my machine.

Dec 28, 2010 at 10:20 PM
dotnetchris wrote:

With more digging I see in NuGet.Tools.pkgdef at line 8:

="NuGet.Tools.NuGetPackage, NuGet.Tools, Version=1.0.11217.102, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"

Which shows a very hard version link to the assemblies which clearly doesn't match what exists on my machine. This is really making me think the build/package process is introducing this error somehow since the binaries don't match package definitions.

 This is interesting. To be clear, this happens when you install from either the Extensions manager and from this codeplex site download page, right?

Dec 28, 2010 at 10:29 PM
dotnetjunky wrote:
dotnetchris wrote:

With more digging I see in NuGet.Tools.pkgdef at line 8:

="NuGet.Tools.NuGetPackage, NuGet.Tools, Version=1.0.11217.102, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"

Which shows a very hard version link to the assemblies which clearly doesn't match what exists on my machine. This is really making me think the build/package process is introducing this error somehow since the binaries don't match package definitions.

 This is interesting. To be clear, this happens when you install from either the Extensions manager and from this codeplex site download page, right?

I can confirm this happens both from the codeplex site and extension manager tool, i've also been able to confirm that this is exactly what other users get in terms of binaries but that they do not suffer the problem I am, that they have the same folder is a different version number than the actual file versions.

Dec 28, 2010 at 10:34 PM

Yes, I can confirm that the assemblies version are different from the VSIX/folder version. This is a bug in our building process. We are investigating why we are not seeing it but you are.

What is your OS? Is it part of a domain? And you said you installed VS SP1 and MVC3 RC2 correct? 

Dec 28, 2010 at 10:37 PM

Can you try installing the slightly older build from http://nuget.codeplex.com/releases/view/52018?

Dec 28, 2010 at 10:58 PM
dotnetjunky wrote:

Yes, I can confirm that the assemblies version are different from the VSIX/folder version. This is a bug in our building process. We are investigating why we are not seeing it but you are.

What is your OS? Is it part of a domain? And you said you installed VS SP1 and MVC3 RC2 correct? 

Win7 x64 Enterprise, part of a domain that is on 2003 Server.

I'm not absolutely certain on the order but I believe this is the sequence that occurred in my entire VS installation

  1. Visual Studio
  2. Visual Studio Power Commands
  3. Resharper
  4. Telerik VS Extension
  5. Hotfix for menu  scrolling when it shouldn't 
  6. MVC3 RC
  7. Upgraded to MVC3 RC2 (note, i had not installed VS sp1 beta, net4 update beta yet)

At this point I started to use Nuget and was able to use it successfully at first, after continued usage of it in trying to create and reference my first nugget/package/gem and encountered the first instance of the error I posted in work item 501 without any action I can attribute to this, the only configuration I did in anyway to Nuget was I added a nuget repository location to a folder that is on a network share that is mapped as a local path.

Upon encountering this error, my first thoughts were to uninstall nuget and download it from codeplex and reinstall nuget, which i did prior to my original opening of 501, with no improvement. I then started googling and eventually found http://www.hanselman.com/blog/VisualStudioExplosionVS2010SP1BETAReleasedAndContext.aspx and saw that MVC3 RC2 was also coupled with associated visual studio sp1 beta and net4 update beta which i then installed both of those, tried visual studio again with no improvement, at this point I tried reinstalling MVC3 RC2 again, no improvement.

After that it has brought me to this point that I have uninstalled and reinstalled Nuget while purging every single other file related to it atleast 12 times.

Will uninstalling Visual Studio even clean up after MVC3, VS SP1 beta, webmatrix/etc? Or do I need to make sure I manually uninstall each and every piece first? I'll wait 1 more day before I get that drastic in case any of you have any final thoughts on this.

Dec 28, 2010 at 11:01 PM
davidebbo wrote:

Can you try installing the slightly older build from http://nuget.codeplex.com/releases/view/52018?

Yes I tried that already and it gave me the same resolution errors with the error message showing the  file versions that were included in that release. (as opposed to the newest version number from my original screenshot)

Dec 28, 2010 at 11:37 PM

Strange, because I think for that older build, the version mismatch didn't exist.

A long shot, but what if you try installing the one from the CI machine: here. It's built with a somewhat different process compared to the official signed build.  Note that this build will not work with VS Express.

Dec 28, 2010 at 11:49 PM

It's not likely due to the version mismatch. I tried changing the version in the pkgdef manually and VS had not problem loading it. I think VS has a fallback mechanism.

If I changed the assembly name though, then VS wouldn't load NuGet.

That leaves us with one remaining possibility, which is that multiple versions of the assemblies are loaded as Fowler said.

Dec 29, 2010 at 12:02 AM

One thing worth trying:

  • Run procmon
  • Set a filter for Path Contain NuGet.Core.dll
  • Run VS
  • Look through procmon entries to see where it may have loaded it from

Note that it seems to try lots of places, which doesn't mean it finds it there.  I think the relevant entries are the ones where the operation says "Load Image".  Though feel free to pastebin the whole thing.  e.g. here is mine.

 

Developer
Dec 29, 2010 at 4:31 AM

You might also want to try the fusion log viewer as well (http://msdn.microsoft.com/en-us/library/e74a18c4(v=VS.100).aspx).

Dec 29, 2010 at 2:58 PM
davidebbo wrote:

One thing worth trying:

  • Run procmon
  • Set a filter for Path Contain NuGet.Core.dll
  • Run VS
  • Look through procmon entries to see where it may have loaded it from

Note that it seems to try lots of places, which doesn't mean it finds it there.  I think the relevant entries are the ones where the operation says "Load Image".  Though feel free to pastebin the whole thing.  e.g. here is mine.

 

http://pastebin.com/gErbY9Z3

My output appears to be nearly identical yours it shows the loadimage occurs in the visual studio directory where expected and that it finds no other DLLS. There is absolutely not any other copies of nuget on this computer unless the binaries magically decided to become invisible.

Developer
Dec 29, 2010 at 3:07 PM

NuGet.Core isn't important here, set a filter for NuGet. instead.

Dec 29, 2010 at 3:30 PM
dfowler wrote:

NuGet.Core isn't important here, set a filter for NuGet. instead.

http://pastebin.com/Srv64G4z

Here's the procmon output from start up of VS 2010 to solution load and my attempt to add library package

Dec 29, 2010 at 4:15 PM

Any guidance? Even if the guidance is just on how to properly uninstall everything?

Developer
Dec 29, 2010 at 4:26 PM

Can you attach a debugger to VS and send a stack trace when the error happens?

Developer
Dec 29, 2010 at 4:50 PM

After studying this error some more it looks like if MEF can't find dte in the container, I'm not sure what would cause that to happen. Are you comfortable with building the nuget sources and attempting to debug this issue?

Coordinator
Dec 29, 2010 at 5:13 PM

Is it possible that there's another version of MEF on that box in the GAC? Perhaps via some pre-release install?

Dec 29, 2010 at 5:25 PM
haacked wrote:

Is it possible that there's another version of MEF on that box in the GAC? Perhaps via some pre-release install?

http://pastebin.com/5s8TVYEz is everything from gacutil /l do you see any issues of multiple versions of MEF

I rarely install any pre-release software, the first real pre-release software I installed was MVC3 RC to be able to use razor + intellisense and nuget.

Dec 29, 2010 at 5:32 PM
dfowler wrote:

After studying this error some more it looks like if MEF can't find dte in the container, I'm not sure what would cause that to happen. Are you comfortable with building the nuget sources and attempting to debug this issue?

I've never attempted to debug visual studio itself before so it's fairly alien to me, starting with my initial thoughts I opened a 2nd copy of visual studio, verified the settings for breaking on exceptions occur for all CLR exceptions thrown and user unhandled. I attached to a 2nd denenv.exe which had a project open, then tried to do add package.

The debugging visual studio did not break in anyway but the error changed to: "GetExportedValue cannot be called before prerequiste import 'NuGet.VisualStudio.SolutionManager..ctor (Parameter="dte", ContractName="EnvDTE.DTE")' has been set." when I tried add package in the visual studio that was being targeted for debugging.

Should I be doing something different? Pulling down the source is an option, yet again I have no experience at all on developing anything for visual studio itself so i might need some guidance on how to actually get any better information from it.

Dec 29, 2010 at 7:13 PM

I have been set back on completing my software since before Christmas due to this. and I don't have the time to continue waiting more days to work on this. So i attempted to uninstall Visual Studio hoping I can peice together back a working enviroment. After uninstalling VS2010 I check my installed programs list and see that VS2010 SP1 is still installed. I attempt to uninstall it and it responds with "A compatible version of Visual Studio 2010 was not detected on the system. This update is designed for only the Microsoft Visual Studio 2010."

It's absurd for an uninstall tool for an update to respond with the original component isn't there so i can't uninstall.

Now I have an environment that's even more screwed up.

Dec 29, 2010 at 10:47 PM
dotnetchris wrote:

I have been set back on completing my software since before Christmas due to this. and I don't have the time to continue waiting more days to work on this. So i attempted to uninstall Visual Studio hoping I can peice together back a working enviroment. After uninstalling VS2010 I check my installed programs list and see that VS2010 SP1 is still installed. I attempt to uninstall it and it responds with "A compatible version of Visual Studio 2010 was not detected on the system. This update is designed for only the Microsoft Visual Studio 2010."

It's absurd for an uninstall tool for an update to respond with the original component isn't there so i can't uninstall.

Now I have an environment that's even more screwed up.

Following this I installed VS again so I could uninstall the SP1..... then I uninstalled VS again. Along with MVC3. Reinstalled VS2010, MVC3, same error. Remove nuget tried the build from the CI server, same error.

At this point I uninstalled the framework beta fixes that went out with SP1, then ran repair on .NET4 and tried again, same error.

I guess I'm left with no other option other than a complete machine reimage tomorrow

Dec 29, 2010 at 10:52 PM

And other than NuGet, everything is working normally?

Dec 29, 2010 at 10:59 PM
davidebbo wrote:

And other than NuGet, everything is working normally?

As far as I can tell, yes. Of course NuGet is a technology I want to start building core development infrastructure around, not the best experiences for that so far.

Dec 29, 2010 at 11:02 PM

Random other thing to try: if you install the PowerConsole VS extension, does it work or fail with similar errors?

Dec 31, 2010 at 1:38 PM
davidebbo wrote:

Random other thing to try: if you install the PowerConsole VS extension, does it work or fail with similar errors?

That extension seems to function normal. i was able to install it, restart vs, opened the power console window and was able to run dir.

Developer
Dec 31, 2010 at 4:23 PM

This is interesting:

The debugging visual studio did not break in anyway but the error changed to: "GetExportedValue cannot be called before prerequiste import 'NuGet.VisualStudio.SolutionManager..ctor (Parameter="dte", ContractName="EnvDTE.DTE")' has been set." when I tried add package in the visual studio that was being targeted for debugging.

I'm not sure what it takes a repro this issue. I think you're going to need to build the NuGet sources and help us help you debug it.

Coordinator
Dec 31, 2010 at 5:49 PM

Or, if you're open to it, allow us remote access to the machine in question via Remote Assistance?

Dec 31, 2010 at 6:29 PM
haacked wrote:

Or, if you're open to it, allow us remote access to the machine in question via Remote Assistance?

As I'm about to be heading out for New Years and we're closed on Monday here, would we be able to setup a time to do this on Tuesday?

I know your schedules must be very busy to start with so if you provide me with any configuration that would accelerate the process that i can get done ahead like pulling down source code and compiling it locally etc I'd be more than happy to take care of that some point this weekend that on Tuesday we can get right down to business and hopefully figure this out.

I was planning to start the building of a new VM today however I completely became absorbed in other efforts so if we resolve this Tuesday it would be a great boon to me to not have to build a new VM and deal with migration of databases etc to it.

Dec 31, 2010 at 9:28 PM

Definitely, you should start by pulling down and building the sources.  You should be able to run the vsix that you build yourself instead of the one from the Extension Manager.  It'll be interesting to see whether you even get the same behavior with that one (I'm guessing you will).

Jan 4, 2011 at 1:49 PM
davidebbo wrote:

Definitely, you should start by pulling down and building the sources.  You should be able to run the vsix that you build yourself instead of the one from the Extension Manager.  It'll be interesting to see whether you even get the same behavior with that one (I'm guessing you will).

I get build failed when running build.cmd when I open the solution file I get

"C:\Projects\nuget_c104b06b1550\src\VsExtension\VsExtension.csproj : error  : The project file 'C:\Projects\nuget_c104b06b1550\src\VsExtension\VsExtension.csproj' cannot be opened.

The project type is not supported by this installation."

I'm running VS2010 ultimate

Developer
Jan 4, 2011 at 2:54 PM

You need to install the Visual Studio SDK. You can find it in the extension manager.

Jan 4, 2011 at 6:29 PM
dfowler wrote:

You need to install the Visual Studio SDK. You can find it in the extension manager.

I have the sources downloaded, built, with the addin installed into VS now, It gives me the same error as I encountered before.

Are we going to pursue the remote assistance route? I've actually never used that tool before on any way, we're behind a VPN to begin with would it just be easier to give you straight remote desktop access?

Developer
Jan 4, 2011 at 10:18 PM

Uninstall the NuGet extension from Visual Studio. Are you setup to use the experimental instance? More notes here http://nuget.codeplex.com/wikipage?title=Development

Jan 10, 2011 at 3:26 PM

This issue is related to this problem: http://nuget.codeplex.com/workitem/472

The issue only happens with projects that have been migrated into VS2010. You can see more of my details in the comment I left on the problem above.

Not sure that this is critical, but it does leave people out in the cold who are moving to MVC for all the bells and whistles like NuGet.

Developer
Jan 10, 2011 at 5:33 PM

Hmm, I cloned blog engine and opened the add reference dialog just fine. Was anyone else able to repro this?

Jan 13, 2011 at 4:35 PM

Any updates since there's been atleast 3 independent confirmations of this?

Jan 13, 2011 at 5:20 PM

We're still investigating this. We haven't been able to repro it internally. Will update this thread as soon as we've found a fix.

Jan 13, 2011 at 7:24 PM
dotnetjunky wrote:

We're still investigating this. We haven't been able to repro it internally. Will update this thread as soon as we've found a fix.

Is there something more than can aid that? Like perhaps getting an intellitrace dump or something?

Feb 17, 2011 at 6:50 PM

Any update on this thread?  I am running into the same issue.  I was able to use NuGet 1.0, but something broke in my VS2010 install.  I think it was the Telerik addins.  I reinstalled VS2010 and I'm getting this issue with 1.1 and 1.2.0 (built from source).  I'm on 2008 R2.I'm open to helping debug this, just need to know what more to look at.

Developer
Feb 17, 2011 at 6:53 PM

I think the reason for this is that NuGet is partially installed in different places on the same machine. When we try to satisfy the MEF import it fails because we found more than one. Try all of the above steps and see if that helps, if not and you can debug the issue, tell us the stack where it blows up and we should be able to investigate more.

Feb 17, 2011 at 7:31 PM

I've gone through everything listed above.  I don't have any other NuGet DLLs left over. 

Here is a screenshot of the call stack and error.  http://dev.bishopit.com/NuGetCallStack.png

Developer
Feb 17, 2011 at 7:38 PM

Can you analyze the properties on error and show some more details?

Feb 17, 2011 at 7:45 PM

The TService is NuGet.VisualStudio.IVsPackageManagerFactory

NuGet.VisualStudio.dll!NuGet.VisualStudio.ServiceLocator.GetComponentModelService<NuGet.VisualStudio.IVsPackageManagerFactory>() Line 40 + 0x3b bytes
NuGet.VisualStudio.dll!NuGet.VisualStudio.ServiceLocator.GetInstance<NuGet.VisualStudio.IVsPackageManagerFactory>() Line 24 + 0x9f bytes
NuGet.Dialog.dll!NuGet.Dialog.PackageManagerUI.PackageManagerWindow.PackageManagerWindow(System.IServiceProvider serviceProvider = {NuGet.Tools.NuGetPackage}) Line 22 + 0x23 bytes
NuGet.Tools.dll!NuGet.Tools.NuGetPackage.ShowAddPackageDialog(object sender = {Microsoft.VisualStudio.Shell.OleMenuCommand}, System.EventArgs e = {Microsoft.VisualStudio.Shell.OleMenuCmdEventArgs}) Line 60 + 0x18 bytes

Is that what you're looking for? 

Developer
Feb 17, 2011 at 7:50 PM

That helps but I mean the actual Errors collection on the composition error exception:

http://msdn.microsoft.com/en-us/library/system.componentmodel.composition.compositionexception.errors.aspx

Feb 17, 2011 at 7:53 PM

{Cannot get export 'NuGet.VisualStudio.VsPackageManagerFactory (ContractName="NuGet.VisualStudio.IVsPackageManagerFactory")' from part 'NuGet.VisualStudio.VsPackageManagerFactory'.}

Developer
Feb 17, 2011 at 8:05 PM

We need to do this over IM :)

Feb 18, 2011 at 6:43 PM

I still have this tab in my firefox continuously as I was able to have this occur on a brand new machine install which throws the nuget binaries idea out the windows. I'd be interested in aiding this discussion still.

Mar 14, 2011 at 7:44 PM

Still occurs continuously after upgrading to SP1 RTW.

Developer
Mar 14, 2011 at 7:46 PM

Does it happen on new projects? Or just one project that you have?

Mar 16, 2011 at 2:10 PM
dfowler wrote:

Does it happen on new projects? Or just one project that you have?

All projects, I created a MVC3 application with the base template Monday right after I installed SP1 to test out Massive and wasn't able to install massive through nuget due to this error. Right after this was when I posted that statement previously.

Mar 16, 2011 at 2:43 PM
JoeDoyle23 wrote:

{Cannot get export 'NuGet.VisualStudio.VsPackageManagerFactory (ContractName="NuGet.VisualStudio.IVsPackageManagerFactory")' from part 'NuGet.VisualStudio.VsPackageManagerFactory'.}

I had this issue this morning. it was because nuget extension was disabled (still don"t know why it was disabled), look in you're extension manager and check if nuget isn't disable (for me it was on a visual studio exp instance)

Mar 16, 2011 at 9:41 PM
mathrb wrote:
JoeDoyle23 wrote:

{Cannot get export 'NuGet.VisualStudio.VsPackageManagerFactory (ContractName="NuGet.VisualStudio.IVsPackageManagerFactory")' from part 'NuGet.VisualStudio.VsPackageManagerFactory'.}

I had this issue this morning. it was because nuget extension was disabled (still don"t know why it was disabled), look in you're extension manager and check if nuget isn't disable (for me it was on a visual studio exp instance)

Nuget Package Manager has a disable button but it is grayed out and not clickable for my VS. Only uninstall is available to me from the extension manager.

Coordinator
Mar 18, 2011 at 1:51 AM

You need to run VS as admin to enable the Disable button.

Mar 18, 2011 at 1:58 AM
haacked wrote:

You need to run VS as admin to enable the Disable button.

His 'uninstall' button is available, so Admin is not the issue. In fact, the Disable button is grayed out for me as well. However, it's available for all my other extensions, so maybe there is something we're not doing quite right relating to supporting Disable.

Well, the hole in this theory is that @mathrb says that in his case NuGet was in fact disabled.

Can you all check whether the Disable button is available for NuGet? Puzzled...

Mar 21, 2011 at 6:16 PM
davidebbo wrote:
haacked wrote:

You need to run VS as admin to enable the Disable button.

His 'uninstall' button is available, so Admin is not the issue. In fact, the Disable button is grayed out for me as well. However, it's available for all my other extensions, so maybe there is something we're not doing quite right relating to supporting Disable.

Well, the hole in this theory is that @mathrb says that in his case NuGet was in fact disabled.

Can you all check whether the Disable button is available for NuGet? Puzzled...

I run my development machine in permanent administrator mode with UAC completely disabled. Maybe UAC being disabled is part of this?

Mar 21, 2011 at 6:16 PM
Edited Mar 21, 2011 at 6:17 PM

double clicked post... can't seem to be able to delete my post only edit it to be this.

Mar 21, 2011 at 6:29 PM
I don't have UAC disabled, but I have it pretty much turned off. I am not seeing any issues.
Mar 24, 2011 at 1:49 PM

Same problem here. We have a solution migrated from VS2008 into VS2010. Installed a latest 1.1 version of NuGet via codeplex download. Have VS2010 with SP1 RTM, Win7x64 Ent with SP1 RTM. 

When I try to add a reference to a project from the library I will get this error:

---------------------------
Microsoft Visual Studio
---------------------------
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'.

Resulting in: Cannot activate part 'NuGet.VisualStudio.SolutionManager'.

Element: NuGet.VisualStudio.SolutionManager -->  NuGet.VisualStudio.SolutionManager -->  AssemblyCatalog (Assembly="NuGet.VisualStudio, Version=1.1.229.159, 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.1.229.159, 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.1.229.159, 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.1.229.159, 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.1.229.159, 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.1.229.159, 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.1.229.159, 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.1.229.159, 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.1.229.159, 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.1.229.159, 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.1.229.159, 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.1.229.159, 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.1.229.159, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")

---------------------------
OK   
---------------------------

When I try to add a reference from the Tools menu, I will get this:
---------------------------Microsoft Visual Studio---------------------------
GetExportedValue cannot be called before prerequisite import 'NuGet.VisualStudio.SolutionManager..ctor (Parameter="dte", ContractName="EnvDTE.DTE")' has been set.
---------------------------OK   ---------------------------

When I try to open console, Visual Studio will crash.

Trying re-installing and cleaned all places from NuGet - doesn't help.
Guys, please help!

Mar 24, 2011 at 2:17 PM
Edited Mar 24, 2011 at 2:31 PM

I confirm that my problems are caused by projects and solutions under Source Control - TFS.

When I dropped all references to TFS in .sln file, everything started working.

Developer
Mar 24, 2011 at 5:25 PM

Try running the latest 1.2 build from the ci machine:

http://ci.nuget.org:8080/repository/download/bt16/1458:id/VisualStudioAddIn/NuGet.Tools.vsix

Mar 24, 2011 at 9:01 PM
LucID wrote:

I confirm that my problems are caused by projects and solutions under Source Control - TFS.

When I dropped all references to TFS in .sln file, everything started working.

I don't use TFS, although the primary project in my shop was created in  VS 2008, used TFS, was taken out of TFS and put under Mercurial then migrated to VS 2010. However Nuget wouldn't work for me even on new blank solutions, I'll try the CI build now.

Mar 24, 2011 at 9:11 PM
dfowler wrote:

Try running the latest 1.2 build from the ci machine:

http://ci.nuget.org:8080/repository/download/bt16/1458:id/VisualStudioAddIn/NuGet.Tools.vsix

I really think you guys fixed it. I installed 1.2 from the link above, created a blank solution with a MVC3 internet application went to add library package and was able to install ELMAH successfully.

I opened up my real projects and went to add library package reference and was able to get to the selection screen again in my live solutions. I'll make sure to post additional feedback as I actually use nuget to confirm.

Apr 6, 2011 at 3:58 PM

I was able to pull in the latest 2.6.2 version of Structure Map into an existing solution for a new web application I created in that solution (which didn't work with nuget previously), everything is working terrific now. Whatever you guys did that fixed this you all did a great job!

Coordinator
Apr 6, 2011 at 4:59 PM

Thanks for the feedback and for following up!