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:38

This issue is because of a MEF cache corruption. Installing the feedback extension (or installing any extension) will invalidate the cache causing VS to rebuild it.

click for source.

查看更多
无与为乐者.
3楼-- · 2018-12-31 23:39

This issue can be resolved by deleting or clearing all the folders and files from %AppData%\..\Local\Microsoft\VisualStudio\11.0\ComponentModelCache

This actually clears the Visual Studio component model cache.

On Windows 7 machines, the path is different. When you type %appdata% in Run dialog, it opens the folder C:\Users\<username>\AppData\Roaming.

Click the 'up' button to navigate to the parent folder and select the folder 'Local'.

Final path: C:\Users\<username>\AppData\Local\Microsoft\VisualStudio\11.0\ComponentModelCache

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

I had to uninstall some external components like Postsharp and Apex and then it worked. I also tried the chosen solution but it gave me more errors.

查看更多
有味是清欢
5楼-- · 2018-12-31 23:41

I had the same problem with Visual Studio Express 2013 of Windows 8.1.

Unfortunatly there was no "ComponentModelCache" folder in
%AppData%..\Local\Microsoft\VisualStudio\12.0\ComponentModelCache.

I found the "ComponentModelCache" folder in
..\Users[username]\AppData\Local\Microsoft\WDExpress\12.0

and solved this problem by removing this folder from there.

查看更多
情到深处是孤独
6楼-- · 2018-12-31 23:42

Remove ComponentModelCache folder content.

 %AppData%..\Local\Microsoft\VisualStudio\11.0\ComponentModelCache
查看更多
永恒的永恒
7楼-- · 2018-12-31 23:45

Visual Studio Express 2012 has different paths.

Visual Studio Express

  • ...\Users\{user}\AppData\Local\Microsoft\WDExpress\11.0\ComponentModelCache

With Visual Studio Express 2012 for Web

  • ...\Users\{user}\AppData\Local\Microsoft\VWDExpress\11.0\ComponentModelCache

I did not have to re-install Visual Studio Express

查看更多
登录 后发表回答