Visual Studio 2010 SP1 crashes on package manager console

Jul 4, 2011 at 10:20 PM
Edited Jul 4, 2011 at 10:22 PM

Hi,
I'm running Windows 7 64 bit SP1 and Nuget version 1.4.20615.9020.
If I go to manage nuget packages then I get a popup error saying:
GetExportedValue cannot be called before prerequisite import 'NuGet.VisualStudio.VsPackageSourceProvider..ctor (Parameter="registrySettingsManager", ContractName="NuGet.VisualStudio.IPackageSourceSettingsManager")' has been set.

When I go to tools - library package manager - package manager console the pane at the bottom appears and says "Initializing Powershell host..." and then Visual Studio says it needs to close.

Event Viewer has a warning event of:

Fault bucket , type 0Event Name: CLR20r3Response: Not availableCab Id: 0Problem signature:P1: devenv.exeP2: 10.0.40219.1P3: 4d5f2a73P4: NuGet.ConsoleP5: 1.4.20609.9012P6: 4df13d4dP7: 154P8: 1eP9: System.NullReferenceExceptionP10: Attached files:These files may be available here:C:\Users\Kevin\AppData\Local\Microsoft\Windows\WER\ReportArchive\Critical_devenv.exe_d82054eb5ba62911179b5cea615726d69b35b34_09105a5f

And then an error event:

The description for Event ID 0 from source VSTTExecution cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer, the display information had to be saved with the event.
The following information was included with the event: 
(devenv.exe, PID 3648, Thread 1) TuipPackage.InitializeTestProjectPlugins: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.QualityTools.CodedUITestPackage, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.File name: 'Microsoft.VisualStudio.QualityTools.CodedUITestPackage, PublicKeyToken=b03f5f7f11d50a3a'   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName)   at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)   at System.Type.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase)   at Microsoft.VisualStudio.TestTools.Tips.TuipPackage.TuipPackage.InitializeTestProjectPlugins()
=== Pre-bind state information ===LOG: User = Kevin-PC\KevinLOG: DisplayName = Microsoft.VisualStudio.QualityTools.CodedUITestPackage, PublicKeyToken=b03f5f7f11d50a3a (Partial)WRN: Partial binding information was supplied for an assembly:WRN: Assembly Name: Microsoft.VisualStudio.QualityTools.CodedUITestPackage, PublicKeyToken=b03f5f7f11d50a3a | Domain ID: 1WRN: A partial bind occurs when only part of the assembly display name is provided.WRN: This might result in the binder loading an incorrect assembly.WRN: It is recommended to provide a fully specified textual identity for the assembly,WRN: that consists of the simple name, version, culture, and public key token.WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/LOG: Initial PrivatePath = NULLCalling assembly : (Unknown).===LOG: This bind starts in default load context.LOG: Using application configuration file: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.ConfigLOG: Using host configuration file: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.DLL.LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/Microsoft.VisualStudio.QualityTools.CodedUITestPackage/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.DLL.LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PublicAssemblies/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.DLL.LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PublicAssemblies/Microsoft.VisualStudio.QualityTools.CodedUITestPackage/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.DLL.LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.DLL.LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/Microsoft.VisualStudio.QualityTools.CodedUITestPackage/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.DLL.LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/TemplateProviders/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.DLL.LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/TemplateProviders/Microsoft.VisualStudio.QualityTools.CodedUITestPackage/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.DLL.LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.DLL.LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/Microsoft.VisualStudio.QualityTools.CodedUITestPackage/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.DLL.LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/x86/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.DLL.LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/x86/Microsoft.VisualStudio.QualityTools.CodedUITestPackage/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.DLL.LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/Editor/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.DLL.LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/Editor/Microsoft.VisualStudio.QualityTools.CodedUITestPackage/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.DLL.LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Platform/Debugger/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.DLL.LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Platform/Debugger/Microsoft.VisualStudio.QualityTools.CodedUITestPackage/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.DLL.LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.EXE.LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/Microsoft.VisualStudio.QualityTools.CodedUITestPackage/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.EXE.LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PublicAssemblies/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.EXE.LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PublicAssemblies/Microsoft.VisualStudio.QualityTools.CodedUITestPackage/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.EXE.LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.EXE.LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/Microsoft.VisualStudio.QualityTools.CodedUITestPackage/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.EXE.LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/TemplateProviders/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.EXE.LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/TemplateProviders/Microsoft.VisualStudio.QualityTools.CodedUITestPackage/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.EXE.LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.EXE.LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/Microsoft.VisualStudio.QualityTools.CodedUITestPackage/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.EXE.LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/x86/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.EXE.LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/PrivateAssemblies/DataCollectors/x86/Microsoft.VisualStudio.QualityTools.CodedUITestPackage/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.EXE.LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/Editor/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.EXE.LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Microsoft/Editor/Microsoft.VisualStudio.QualityTools.CodedUITestPackage/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.EXE.LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Platform/Debugger/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.EXE.LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/CommonExtensions/Platform/Debugger/Microsoft.VisualStudio.QualityTools.CodedUITestPackage/Microsoft.VisualStudio.QualityTools.CodedUITestPackage.EXE.
the message resource is present but the message is not found in the string/message table

Any ideas?
Thanks

Aug 19, 2011 at 10:13 AM

I am also experiencing the exact same error. Nuget doesn't work at all anymore on my computer.

Aug 19, 2011 at 9:22 PM

Strange. Do you have any interesting add-ins installed? We've seen a couple that didn't work well with NuGet, so it may be worth disabling them all as a test.

Aug 20, 2011 at 2:12 AM

Looks similar to this: https://connect.microsoft.com/VisualStudio/feedback/details/549444/visual-studio-2010-rc-crash

Aug 20, 2011 at 9:16 AM

@davidebbo; I currently have these installed in Extension Manager

  • Indend Guides (tried disabling, did nothing)
  • JScript Brace Matching Extension
  • JScript Editor Extensions
  • JScript Intellisense Para Extension
  • JScript Outlining Extension
  • JScript Word Highlighting Extension
  • Nuget Package Manager (1.4.20701.9038)
  • Process Template Editor
  • Productivity Power Tools (tried disabling, did nothing)
  • SpecFlow
  • WITDesigner

Indend Guides was newly installed, but disabling it solves nothing. SpecFlow was newly upgraded, but can't disable that...

I compared the entire nuget folder in Winmerge (C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft Corporation\NuGet Package Manager\1.4.20701.9038\) with my collegues (his nuget work), and it was exactly the same.

I guess the next thing to try would be to reinstall Visual Studio...

Aug 20, 2011 at 9:40 AM

I've tried disabling all the others, but the error still occurs. I don't get the log message in my Event Viewer the thread creator gets though.

The first time I click "Manage Nuget Packages" I get: "GetExportedValue cannot be called before prerequisite import 'NuGet.VisualStudio.VsPackageSourceProvider..ctor (Parameter="registrySettingsManager", ContractName="NuGet.VisualStudio.IPackageSourceSettingsManager")' has been set."

Any subsequent clicks I get; "Internal error occurred. Additional information: ''." 

Aug 20, 2011 at 4:25 PM

Even more info;

When trying to open the "Nuget console", I get a more detailed error with a callstack, don't know if this helps you more

https://img.skitch.com/20110820-i8qke7a3mwxy2kai39b7j7kbx.png

(I was unable to copy the error directly, I got a null reference error while pressing CTRL+C, but that's a screenshot of it) :)

Aug 20, 2011 at 4:45 PM

The error ".' hexadecimal value 0x00 is an invalid character" comes up a lot in search, but not in the context of NuGet.

The message also contains "The type initializer for 'Nuget.Settings' threw an exception", which may mean an issue with the nuget settings file.

Can you go to your %appdata%\nuget folder and check for a NuGet.config file there? Maybe it got somehow corrupted. Can you try deleting it (back it up first) to see if that affects the issue?

Other test: does Nuget.exe work correctly? e.g. run 'nuget install jquery'

Aug 20, 2011 at 5:07 PM

The NuGet.config was empty (well not really, it contained one row with alot of whitespace).

After deleting it, my problems disappeared. NuGet is working correctly now. Thanks a bunch!! 

Aug 20, 2011 at 5:09 PM

Yeah! Would be nice to understand how it got into that state, but at least next time someone hits this, they'll know what to check for :)

Oct 17, 2011 at 9:45 PM

Same issue after a Windows crash (my ssd has issues). Nuked all the NuGet appdata files and it worked again.

Oct 22, 2011 at 8:39 AM

Same issue here, I opened Nuget.config and it has some binary garbage in it!! 

Deleting it and restarting visual studio fixed it!