Tuesday 18 August 2015

No exports were found that match the constraint contract name in VISUAL STUDIO

When i was exploring the solution explore in visual studio, suddenly at the time of open a file in editor was showing error No exports were found that match the constraint contract name.

No exports were found that match the constraint:
ContractName
Microsoft.VisualStudio.Utilities.IContentTypeRegistryService
RequiredTypeIdentity
Microsoft.VisualStudio.Utilities.IContentTypeRegistryService

I was stuck with the problem, after some time i found some where on web,

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

Just delete or rename this folder:

%AppData%\..\Local\Microsoft\VisualStudio\11.0\ComponentModelCache
or
%AppData%\..\Local\Microsoft\VPDExpress\11.0\ComponentModelCache
For Visual Studio 2013, change the version number:

%AppData%\..\Local\Microsoft\VisualStudio\12.0\ComponentModelCache
For Visual Studio 2015, change the version number:

%AppData%\..\Local\Microsoft\VisualStudio\14.0\ComponentModelCache
Restart Visual Studio.