2

I'm facing a problem where I can't open .cs files in Visual Studio 2013 after one day.

It started on Monday: I opened an existing solution and tried to open the Program.cs file but instead was met with the following error message (rough translation):

No exports were found that meet the constraint:

ContractName

Microsoft.VisualStudio.Utilities.IContentTypeRegistryService

RequiredTypeIdentity

Microsoft.VisualStudio.Utilities.IContentTypeRegistryService

I tried opening .cs files in different solutions and always got the same message. The only exception being: Any Visual Studio instance that was opened before the Visual Studio instance in which the exception first occured was/is not affected by this.

I managed to get it working by choosing to repair the Visual Studio installation and rebooting but that only worked until the next day.

I tried searching for that message but got nothing so far.

Steffen Winkler
  • 2,805
  • 2
  • 35
  • 58
  • 1
    Already solved in here, the same should work since 2012 and 2013 are very similiar http://stackoverflow.com/questions/19217506/error-in-microsoft-visual-studio-2012-no-exports-were-found-that-match-the-cons – Jonathan Camilleri Jul 15 '15 at 08:03
  • 1
    @JonathanCamilleri this is rather embarrassing...I even edited an answer on that question 12 days ago. – Steffen Winkler Jul 15 '15 at 08:21

2 Answers2

6

Delete or rename this folder:

C:\users\\AppData\Local\Microsoft\VisualStudio\12.0\ComponentModelCache\

ΦXocę 웃 Пepeúpa ツ
  • 47,427
  • 17
  • 69
  • 97
bot_insane
  • 2,545
  • 18
  • 40
0

I had this issue and seems the file was open - but I could see what pane or anything. So I had to right click on a file and close all documents - then I could open the file again.

ajwaka
  • 608
  • 1
  • 7
  • 12