Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error message "No exports were found that match the constraint contract name"

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?

like image 820
Simon B.Robert Avatar asked Jul 11 '13 14:07

Simon B.Robert


3 Answers

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

Visual Studio 2019 is 16.0

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

For those who have multiple versions of Visual Studio installed, e.g. 2012 and 2013, it might help to remove the ComponentModelCache for both versions before restarting Visual Studio, e.g. 11.0 and 12.0.

like image 110
Simon B.Robert Avatar answered Oct 24 '22 01:10

Simon B.Robert


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.

like image 22
Ananta Sundar Shrestha Avatar answered Oct 24 '22 03:10

Ananta Sundar Shrestha


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

like image 73
They call me Trinity Avatar answered Oct 24 '22 02:10

They call me Trinity