Home: Operation failed Expected 1 export(s) with contract name "NuGet.Configuration.ISettings" but found 0 after applying applicable constraints

Created on 24 Jun 2016  路  21Comments  路  Source: NuGet/Home

I've tried reinstalling and repairing visual studio 2015 but nothing has alleviated this error message that prevents me from interacting with the Nuget Package Manager in any way. Any attempt to interact with Nuget through the VS UI results in the error message below.

image

I attempted to do a manually install of the package manager, but this install removes any ability to access Nuget packages from the UI all together. The option to select it from the "Tools" menu is gone as well as the option fromt eh menu when right clicking to add references to a project. If you attempt to access it through the Options dialog within the "Tools" menu, I get this

image

Please respond ASAP. We are developing Enterprise applications at the my current place of employment and my machine is the only one encountering this problem. It will become a serious issue in the near future as we develop shared libraries for our applications to use

Thanks

VS.Client External Bug

Most helpful comment

Deleting everything in that folder is fine, _%localappdata%\Microsoft\VisualStudio\14.0ComponentModelCache_ is the critical part to delete. Visual Studio caches all of the extensions it knows about into this folder. This often gets out of date and Visual Studio doesn't update it properly, which is what you are most likely hitting here.

The NuGet team has been working with the Visual Studio platform team to improve support for extensions.

All 21 comments

Please give details of versions of VS and NuGet.
Happening to more than one machine?

Here are some general steps that may help.

  1. From tools > extensions and updates > Installed, uninstall NuGet Package Manager
  2. Close all instances of visual studio
  3. Delete _%localappdata%\Microsoft\VisualStudio\14.0_
  4. Download NuGet 3.4.4 VSIX for 2015 from https://dist.nuget.org/index.html
  5. Double click the VSIX you downloaded to install it
  6. Run the Visual Studio developer command prompt as Admin, and execute devenv.exe /setup (wait until the process finishes, you may need to check task manager for it)
  7. Start Visual Studio 2015 again

@rrelyea The version of Visual Studio is 2015 and NuGet I'm assuming 3.4 but I'm not sure. it is the default version that comes with the 2015 VS install. My machine is the only one of the machines our dev team is using that is experiencing this problem

@emgarten Are you saying delete ALL files under %localappdata%\Microsoft\VisualStudio\14.0?
I've found some other posts that sya to delete everything under %localappdata%\Microsoft\VisualStudio\14.0ComponentModelCache
Will this break my install?
When I look at tools > extensions and updates > Installed I dont see Nuget listed
image

But I have that option in the Tools menu
image

I managed to find a very wonky solution that managed to fix the problem for now. However, you should address this issue to find a permanent long-term solution.

Link to solution i used: http://nuget.codeplex.com/workitem/3031

Deleting everything in that folder is fine, _%localappdata%\Microsoft\VisualStudio\14.0ComponentModelCache_ is the critical part to delete. Visual Studio caches all of the extensions it knows about into this folder. This often gets out of date and Visual Studio doesn't update it properly, which is what you are most likely hitting here.

The NuGet team has been working with the Visual Studio platform team to improve support for extensions.

Glad that the double install fixed this for you. We have no other customer reports of this issue, we'll pay attention to any future reports and investigate if this impacts more people.
If you hit again, please let us know how you did it.

Hello.

I have a similar problema but diferent VS versi贸n. I have installed the community edition.
Any idea of what can i do to fix this problem? I'll appreciate this.

@madnemesio try the steps mentioned above, they apply to all versions of vs.

I installed .net 4.6.2 and ran into this issue.

Maybe this helps:

Delete the contents from the following folders:
C:\Users{user}\AppData\Local\Microsoft\VisualStudio
C:\Users{user}\AppData\Local\Microsoft\VSCommon
Sometimes, you need to go to:
[x64] C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE
[x86] C:\Program Files\Microsoft Visual Studio 14.0\Common7\IDE
and run Visual Studio 2015 again

This works good for me
Have a happy coding !

Tks Bhavik1812. Works for me!

@emgarten 's deletion of the ComponentModelCache folder worked for me. Thanks!

The following error message occurred in my Package Manager Console (Visual Studio 2017 Professional 15.8.0):
Expected 1 export(s) with contract name "NuGet.PackageManagement.VisualStudio.IScriptExecutor" but found 0 after applying applicable constraints.

Deleting the ComponentModelCache folder as @emgarten recommended worked fine! :)

Upgraded from .Net Core 2.0 to 2.1 by installing the .Net Core 2.1 SDK. Upgraded to Visual studio 2017 15.9.4 The same issue occurs.

Confirm that deleting the ComponentCache and restarting Visual Studio fixed it for me:

Visual Studio Version: VS 2017 15.9.4
C:\Users\\AppData\Local\Microsoft\VisualStudio\15.0_b4a85ab0ComponentModelCache <== DELETED
Restart Visual Studio and all working.

I had same issue but i dont have appdata folder or componantmodelcache folder , what should i do ??

I had the same issue with Visual Studio Professional 16.1.0 (except the error I got referenced NuGet.PackageManagement.VisualStudio.IScriptExecutor). I got the error when creating a new ASP.NET MVC 4.7.2 project and accepting the defaults. It created some of the files for the project, but the project was unusable. Deleting the ComponentModelCache folder from \AppData\Local\Microsoft\VisualStudio\16.0_2f0c43fa and restarting fixed the problem for me.

I had same issue but i dont have appdata folder or componantmodelcache folder , what should i do ??

I have almost the same issue. I don't have any ComponentModelCache folder. :( How do I solve this?

Here are some general steps that may help.

  1. From tools > extensions and updates > Installed, uninstall NuGet Package Manager
  2. Close all instances of visual studio
  3. Delete _%localappdata%\Microsoft\VisualStudio\14.0_
  4. Download NuGet 3.4.4 VSIX for 2015 from https://dist.nuget.org/index.html
  5. Double click the VSIX you downloaded to install it
  6. Run the Visual Studio developer command prompt as Admin, and execute devenv.exe /setup (wait until the process finishes, you may need to check task manager for it)
  7. Start Visual Studio 2015 again

Hello, Sir. I have gone to Tools > Extensions and Updated but then it says a warning, "Object reference not set to an instance of an object."

How should I solve this?

Maybe this helps:

Delete the contents from the following folders:
C:\Users{user}\AppData\Local\Microsoft\VisualStudio
C:\Users{user}\AppData\Local\Microsoft\VSCommon
Sometimes, you need to go to:
[x64] C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE
[x86] C:\Program Files\Microsoft Visual Studio 14.0\Common7\IDE
and run Visual Studio 2015 again

This works good for me
Have a happy coding !

This fixed it for me. Only in my case it was VS 2017 community edition.
Thanks @Bhavik1812

Was this page helpful?
0 / 5 - 0 ratings