Error message “No exports were found that match th

2018-12-31 23:13发布

This morning I faced a problem while opening my Visual Studio solution, and when I tried to run it, it said:

No exports were found that match the constraint contract name

How can I fix this problem?

24条回答
宁负流年不负卿
2楼-- · 2018-12-31 23:57

I got this error after reinstalling IntelliJ IDEA and ReSharper for C# in Visual Studio 2013.

First, I got an error problem with extensions, and after this I got this error:

"No exports were found that match the constraint contract name”

I simply removed folder ComponentModelCache and resolved this error.

查看更多
低头抚发
3楼-- · 2018-12-31 23:58

Deleting the Component Model Cache did not work for me (well, the relative directory given above did not exist in my machine). Instead, I installed an extension to Visual Studio 2012 Express. Menu Tools → *Extensions and Updates...** → OnlineChoose any and then download. This apparently invalidates the cache causing Visual Studio to rebuild it.

Here's my source.

查看更多
千与千寻千般痛.
4楼-- · 2018-12-31 23:59

For Visual Studio 2013 you need to remove that folder from this path:

%AppData%\..\Local\Microsoft\VisualStudio\12.0
查看更多
回忆,回不去的记忆
5楼-- · 2018-12-31 23:59

I experienced a similar problem after some updates released from Microsoft (part of them where about .NET framework 4.5).

On the Internet I got the following link to the Microsoft knowledge base article:

Update for Microsoft Visual Studio 2012 (KB2781514)

It worked for me.

查看更多
琉璃瓶的回忆
6楼-- · 2018-12-31 23:59

I got an error with the same error message - two years later. It's a different problem this time though, related to .NET Core dnx things.

I couldn't find an answer on Stack Overflow, but in a GitHub issue it contains a workaround: https://github.com/aspnet/Home/issues/1455

Below is the most important part of the workaround:

  • Delete the entire C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\DNX directory. (As far as I understand, it belongs to the old version of ASP.NET Core RC1, which for some reason is still shipped even with Visual Studio 2015 Update-3).
  • Delete the C:\Users\<user>\AppData\Local\Microsoft\VisualStudio\14.0\devenv.exe.config file.
  • Run the Developer Command Prompt for Visual Studio 2015 as Administrator, and execute the devenv /setup command. The new devenv.exe.config file is generated. This time there are many assemblies that refer to the C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\DotNet directory.
  • Run the Visual Studio 2015 and check that it shows the Microsoft .NET Core Tools (Preview 2) 14.1.20624.0 in the Help => About Microsoft Visual Studio menu.

Thanks to olegburov's post on GitHub for figuring this out.

查看更多
看淡一切
7楼-- · 2019-01-01 00:05

I have Windows 7 x64 with a second partition on which Windows 8 (preview installed). While working with Microsoft Visual Studio Express 2012 for Windows Phone, I come up with the same problem. But the ComponentModelCache is found here:

C:\Users\Jayaram\AppData\Local\Microsoft\VPDExpress\11.0

I am unable to delete or rename as I get the "access is denied" message when I try to use command prompt:

Administrator: VS2012 X64 CrossToolsCommandPrompt

查看更多
登录 后发表回答