Sam
Sam

Reputation: 5647

Why do I get the message "The 'NuGetPackage' package did not load correctly"?

I spent the weekend Updating my Visual Studio 2015 installation to Update 3. And I installed the Core .Net CLI (Command Tools Interface). And rant the update "ASP.Net and WebTools tooling".

I get back to work, start Visual Studio, open our project, and now I get this:


The 'NuGetPackage' package did not load correctly.

The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by examining the file:

'C:\Users\samuel\AppData\Roaming\Microsoft\VisualStudio\14.0\ActivityLog.xml'

Restarting Visual Studio could help resolve this issue.

Continue to show this error message?


Here is the error from the Activity Log:

CreateInstance failed for package [NuGetPackage]Source:
  'mscorlib'
  Description: Could not load file or assembly 'NuGet.Tools,        Version=3.4.4.1321, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
  or one of its dependencies.
  The system cannot find the file specified.
  
  
System.IO.FileNotFoundException:
  Could not load file or assembly 'NuGet.Tools, Version=3.4.4.1321,     Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
  or one of its dependencies. The system cannot find the file     specified.
File name: 'NuGet.Tools, Version=3.4.4.1321,     Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

  at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String     codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint,     StackCrawlMark& stackMark, IntPtr pPrivHostBinder,     Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean     suppressSecurityChecks)

  at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String     codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint,     StackCrawlMark& stackMark, IntPtr pPrivHostBinder,     Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean     suppressSecurityChecks)

  at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName        (AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly     reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean     throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)    

  at System.Activator.CreateInstance(String assemblyString, String     typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[]     args, CultureInfo culture, Object[] activationAttributes, Evidence     securityInfo, StackCrawlMark&
  stackMark)
   at System.Activator.CreateInstance(String     assemblyName, String typeName)

  at System.AppDomain.CreateInstance(String assemblyName, String typeName)    


  WRN: Assembly binding logging is turned OFF.

  To enable assembly bind failure logging, set the registry value         [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.

  Note: There is some performance penalty associated with assembly bind     failure logging.
  &#x000A;To turn this feature off, remove the registry value     [HKLM\Software\Microsoft\Fusion!EnableLog].&#x000D;&#x000A;</description>
  <guid>{5FCC8577-4FEB-4D04-AD72-D6C629B083CC}</guid>

Uninstalling and reinstalling Nuget Package Manager from Tools -> Extensions an Updates seems to have fixed it.

We'll see. Someone on another post said they thought it worked but then came back and said it didn't: VS2015 - The 'NuGetPackage' package did not load correctly

Upvotes: 0

Views: 3168

Answers (2)

Ervis Trupja
Ervis Trupja

Reputation: 2800

Check out this answer: VS2015 - The 'NuGetPackage' package did not load correctly

Completely removing NuGet via Extensions and Updates, restarting VS then re-installing NuGet via Extensions and Updates solved the issue for me. A full VS reinstall was not necessary.

Upvotes: 2

Bellash
Bellash

Reputation: 8184

You need to click on update or re-install the nuGet via Extensions and Updates.

Tools > Extensions and Updates Updates > Visual Studio Gallery > Nuget Package

Upvotes: 1

Related Questions