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

This will really work like a champ:

Solution: Try to delete ComponentModelCache folder from the below location.

[C:]\Users\[your user name]\AppData\Local\Microsoft\VisualStudio\[Visual Studio version number]

And after successful delete, recreate the folder with the same name, "ComponentModelCache".

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

I solved this problem by clearing Visual Studio Component Model Cache.

Just delete or rename this folder:

%LocalAppData%\Microsoft\VisualStudio\11.0\ComponentModelCache

or

%LocalAppData%\Microsoft\VPDExpress\11.0\ComponentModelCache

and restart Visual Studio.

The version of Visual Studio you have is specified by the number e.g.

Visual Studio 2012 is 11.0 (as shown above)

Visual Studio 2013 is 12.0

Visual Studio 2015 is 14.0

Visual Studio 2017 is 15.0

For those that don't know: %LocalAppData%\ is the same as C:\Users\{yourUsername}\AppData\Local

查看更多
君临天下
4楼-- · 2018-12-31 23:46

No need to rename or delete the whole folder:

(%AppData%\..\Local\Microsoft\VisualStudio\11.0\ComponentModelCache)

Just rename or delete the Microsoft.VisualStudio.Default.cache file inside the above location.

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

for Visual Studio 2012 and later versions, the solution must be deleting the content of the folder ComponentModelCache:

C:\Users\[username]\AppData\Local\Microsoft\WDExpress\11.0\ComponentModelCache

Visual Studio 2013

C:\Users\[username]\AppData\Local\Microsoft\VisualStudio\12.0\ComponentModelCache
查看更多
伤终究还是伤i
6楼-- · 2018-12-31 23:50

I had the same problem upon launching Visual Studio 2013 Ultimate, and the solutions here didn't work for me. I tried deleting the mentioned folders and starting Visual Studio again, but it didn't work.

However I had other problems too, like Microsoft.visual studio package did not load correctly and also Page '312e8a59-2712-48a1-863e-0ef4e67961fc' not found VS 2012. The latter refers to a message in the Team Explorer window saying "Page 'somenumber' cannot be found".

So I run devenv /setup on the Visual Studio command prompt with administrative rights. It did the job, and everything is fine now.

查看更多
与风俱净
7楼-- · 2018-12-31 23:51

If you have VS 2013, you have to go to: %LOCALAPPDATA%\Microsoft\VisualStudio\12.0 then rename the ComponentModelCache folder.

查看更多
登录 后发表回答