[Solved-5 Solutions] Error message “No exports were found that match the constraint contract name”
- We face a problem while opening a Visual Studio solution, and when we try to run it, it will say:
No exports were found that match the constraint contract name
- We can solve this problem by clearing Visual Studio Component Model Cache.
- Just delete or rename this folder:
- We can run
devenv /setupon the VS Command Prompt with administrative rights.
- We can go to 'Programs and Features' and use the change button to startup the Visual Studio 2013 setup.
- In the setup we need to choose the repair function and that will fix the problem.
- 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.
- Delete the entire C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\DNX directory.
- Delete the C:\Users\\AppData\Local\Microsoft\VisualStudio\14.0\devenv.exe.config file.
- Run the Developer Command Prompt for VS2015 as the 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 VS 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.