Vishwanath Mishra
Vishwanath Mishra

Reputation: 445

VS 2013 Error-"No exports were found that match the constraint:"

I am using Visual Studio 2013 on Windows 10, Today I am getting error "No exports were found that match the constraint:"

I did following but still having same issue:

  1. Solution giving in link Error message "No exports were found that match the constraint contract name"

by removing/renaming "ComponentModelCache" folder, but still problem.

  1. Run VS Repair, but still having same problem.

  2. Finally, I Uninstalled Visual Studio 2013 and reinstalled, but still having same problem.

Please suggest what do do now?

Upvotes: 1

Views: 9131

Answers (3)

user8941881
user8941881

Reputation: 1

Apologies for contributing to an old "answered" thread. however for me, using Win 10, VS 2013. I had to remove the 'ComponentModelCache' folder from each version of VS that I had installed before this issue was resolved.

Upvotes: 0

adielas
adielas

Reputation: 39

You can see here more solutions which require deleting the cache in %APPDATA%.

In my case, the problem was that I was initializing and using class with the MEF framework but didn't declare the class as a MEF class.

How to import a MEF class:

[Import(typeof(ICalculator))]  
public ICalculator calculator;

How to define and export a MEF class:

public interface ICalculator  
{  
     String Calculate(String input);  
}  

[Export(typeof(ICalculator))]  
class MySimpleCalculator : ICalculator  
{
}

The code example is taken from here

Upvotes: 1

Vishwanath Mishra
Vishwanath Mishra

Reputation: 445

Finally, I did find answer myself, instead of deleting/renaming 'ComponentModelCache' folder in path C:\Users\'username'\AppData\local\Microsoft\VisualStudio\12.0

I renamed folder 'Microsoft' in path C:\Users\'username'\AppData\local\

This works for me.

Upvotes: 1

Related Questions