4

While attempting to build or open a project in Visual Studio 2015 14.0.25431.01 Update 3 which I recently updated, I keep getting errors around nuget package management. Whenever I build the project the first time after opening VS, I get the error message below. I also get it when I try to open the nuget package manager dialog. Anyone else experience this?

An exception was thrown while initializing part
"Nuget.PackageManagement.VisualStudio.VSolutionManager".
GetFullVsVersionString must be called on the UI thread.

1

Adam
  • 4,590
  • 10
  • 51
  • 84
  • I am on VS 2015 Update 3.1 and am facing the same issue.. I wonder if this has any relation to xamarin..? – bit Sep 25 '16 at 09:28
  • I don't think so. I don't have any xamarin dependency in my project, still facing this problem. :( – Yeasin Abedin Oct 17 '16 at 16:46

8 Answers8

7

I had the exact same issue as you and I was able to get NuGet to work again for me by doing the following simple steps.

  1. Completely close all versions and windows of Visual Studio
  2. Reopen a blank Visual Studio window
  3. Navigate to Tools -> NuGet Package Manager -> Package Manager Settings
  4. Press "OK"
  5. Open the project you were having issues with
  6. Try opening "Manage NuGet Packages..." or running your project

Your issue should now be fixed!

I had originally tried uninstalling NuGet and reinstalling it through the "Extensions and Updates" under "Tools" to no avail. The solution I listed above fixed it instantly.

Jolley71717
  • 678
  • 1
  • 8
  • 20
  • 1
    It's only temporary. Close and open VS and it recurs. – Steve Greene Feb 19 '17 at 23:03
  • I have discovered that as well. It's definitely a band-aid until I figure out what the actual problem is, and how to fix it. It is a pain, but if I just keep the project open, it works. – Jolley71717 Feb 21 '17 at 19:38
5

It appears reinstalling Nuget Package Manager for Visual Studio in the Extensions & Tools dialog may have fixed it.

Adam
  • 4,590
  • 10
  • 51
  • 84
4

-First Delete all cache on C:\Users\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache

-Second Reinstall Nuget package manager by Tools->Extensions and Updates. After that restart your visual studio

-Third Go to Tools->Nuget Package Manager->Package Manager Settings of blank project (for create new cache), and after that, try on your project

Ali Ridho
  • 63
  • 1
  • 7
3

I was getting this with a Visual Studio Extension from Telerik. Once I uninstalled it went away.

Steve Greene
  • 12,029
  • 1
  • 33
  • 54
2

In VisualStudio 2015 -> Tools -> Extensions and updates -> Online: Search for the string: "Fix NuGet GetFullVsVersionString must be called on the UI thread" and install the given fix.

Alternatively you can download the fix at : GetFullVsVersionString fix

Now in February 2018, the latest NuGet Package Manager version 3.4.4.1321 does not have the fix included, so the patch must be applied.

As Steve Greene's answer describes, I also had the Telerik extension installed, so that might have caused the problem.

Rick
  • 1,177
  • 1
  • 19
  • 27
Vlad S.
  • 438
  • 6
  • 7
  • I was not able to find this extension/update. I gather it is no longer available? – Der Wolf May 20 '20 at 20:27
  • 1
    @DerWolf Indeed, I checked now and I do not find the extension anymore, nor in the VS Marketplace or in the VisualStudio2015. Also there is no newer version of the NuGet Package Manager. I still see the extension installed in my VisualStudio 2015 but I don't know how to share it. It was published by a VS Marketplace profile called "kzu" who also have a lot of NuGet packages published. – Vlad S. May 26 '20 at 14:42
1

This problem can happen if you have Xamarin for Visual Studio installed. There is a NuGet bug reported about this.

If you have Xamarin component in one of your projects and then try to use NuGet then NuGet can be called on the wrong thread.

There is a separate Xamarin extension that can be installed to fix this problem with Xamarin for Visual Studio.

Matt Ward
  • 47,057
  • 5
  • 93
  • 94
0

Run the Visual Studio as 'Run as administrator' mode.

If it does not work then, if you have other version of Visual Studio like 2013 then uninstall all and install again.

Khademul Basher
  • 127
  • 1
  • 2
0

This is what worked for me (VisualStudio 2015):

  • Uninstalling NuGetPackageManager in Tools->Extensions and Updates.
  • Closing all open VisualStudio.
  • Deleting the cache on C:\Users\user\AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache
  • Restart PC
  • Install NuGetPackageManager in Tools->Extensions and Updates in a blank application or on the startup VisualStudio screen.
  • Close every VisualStudio again.
  • Finally it should work.

I had to follow this process or it did not work.

CelloH3r0
  • 29
  • 1
  • 9