0

Last night, I updated Visual Studio 2015 on my system from RTM to Update 2. I now get an error message when I try to add a new View to an ASP.Net MVC application I am working on:

There was an error running the selected code generator:
'Expected 1 export(s) with contract name "NuGet.VisualStudio.IVs.PackageInstaller" but found 0 after applying applicable constraints.'

Any ideas on how to fix this? I had no trouble adding a few views to this project yesterday before I installed the update.

Pizzor2000
  • 379
  • 3
  • 19

2 Answers2

0

tl;dr - Reinstall NuGet Package Manager

I know this is an old thread. But I encounter the same error message today and found no solution online that works for me. So I decided to answer on this old thread for future devs that will encounter the same error message.

The reason for my case is that my NuGet Package Manager was missing. I recently installed Wekan and it required me to install Visual C++ 2015 Build Tools, and I think that might be the culprit why NuGet was removed.

So, my solution is to download and reinstall NuGet Package Manager:

  • In Visual Studio open Extensions and Updates Tools > Extensions and Updates (or by pressing ALT+T+U)
  • On the left pane click Online and search for keyword NuGet Package Manager for Visual Studio 2015, download/install
  • Restart VS

These are the other solution that worked for some (didn't work for me):

Community
  • 1
  • 1
jomsk1e
  • 3,585
  • 7
  • 34
  • 59
-1

Updating the VS2015 will force you to update after that the whole work you have done so far. Most of the references specially NuGet are changed or outdated in 2015. I am currently using vs2013 with MVC5. I would suggest you to update the references and find a solution about this NuGet package. It might be no longer available for this view you want to add. In addition, there is a similar topic with Q&A to your and it is accessible right here: Unable to Install Any Package in Visual Studio 2015 . Take a look but VS2015 the free version is not that good for coding. Better download visual studio 2013 with update 5 and you will be much better. If you still want to keep it with VS2015, take a look at this and download it.

VS2015 NuGet Manager:

https://visualstudiogallery.msdn.microsoft.com/5d345edc-2e2d-4a9c-b73b-d53956dc458d

Community
  • 1
  • 1