5

When I open a C++ project created recently on Visual Studio 2015 I am able to debug it and have it run, but the code window is blank. I've clicked all around and can not find anything to show me the code so I can continue to work on it.

I have tried:

  • F7: View Code does not work.
  • Opening from the Solution Explorer window does not do anything.
  • Searching Google, Stack Exchange, and YouTube tutorials for my identical problem.

I suspect it is a very straightforward misunderstanding of the interface on my part, but wanted to get involved on Stack Exchange to figure it out.

[Screenshot of VS2015 at point of problem.

10 Rep
  • 2,217
  • 7
  • 19
  • 33
glycci
  • 61
  • 1
  • 1
  • 5
  • 6
    Someone played a practical joke on you and set a font color matching the background? – GSerg Sep 20 '16 at 18:03
  • Too much work for a joke. Please notice that even the left-hand-side vertical bar where you set breakpoints is missing. I woudl say, broken VS installation. After opening a file from SolutionExplorer and when "empty space" shows up, click on that empty space and press control+a. This shortcut should select all text out there in that file, and you should be able to see at least the shape of the lines. If you see that, then probably a joke. If not, then I;d suggest reinstalling VS, and/or installing any .Net updates and/or graphic card drivers. – quetzalcoatl Sep 20 '16 at 18:12
  • 1
    One more check for a joke - after pressing control+a, regardless of if you see effect or not, try control+c (or 'copy' from edit menu, etc) and pasting it to notepad. If that's a problem with colors and UI styling, you will succeed and notepad will receive text. If no text received -> broken editor component, reinstall VS. – quetzalcoatl Sep 20 '16 at 18:15
  • For repairing colors, first try changing "theme" i.e. from dark to bright. I hope that helps. It should help, if the joker was lazy. See https://msdn.microsoft.com/en-us/library/hh923906.aspx or https://www.youtube.com/watch?v=vk6JQwTonXA If that doesn't help, you can try playing manually with https://blogs.msdn.microsoft.com/zainnab/2011/01/18/reset-fonts-and-colors/ and try editing "Text editor" group, but there's quite a bit of options to set (and guess), actually reinstall may be faster. – quetzalcoatl Sep 20 '16 at 18:20
  • 1
    No one else has (in person) access to my computer, so I doubt it was a joke. CTRL-A and CTRL-C to copy/paste showed nothing. I will try to reinstall, I guess. I only installed it last week and was able to write and read the code just a few days ago, but only upon the initial creation of the project. – glycci Sep 20 '16 at 18:20
  • Reinstalled and is working so far. Thank you! – glycci Sep 21 '16 at 03:01
  • Strange, now I got the same problem... – arc_lupus Jan 26 '17 at 15:17
  • 2
    @glycci: For the future: Try the first answer to this question: http://stackoverflow.com/questions/17596543/error-message-no-exports-were-found-that-match-the-constraint-contract-name – arc_lupus Jan 26 '17 at 15:31
  • Start VS2015 as administrator and you'll see the code window again. – GianCarlo Onnis May 14 '17 at 11:38
  • Just had the same problem. The solution suggested by @GianCarloOnnis worked for me: close VS and start it again as administrator. (once is enough) I can only guess that there is some silent update which demands admin priviledge. (Cannot post this as answer unfortunately, thought I had rep enough.) – Guran Aug 17 '17 at 06:14

2 Answers2

13

Fixed with the following for me.

Change 'Color Theme' to something other that what you have. Tools -> Options -> Environment -> Color theme:

Select OK then exit Visual Studio.

Open project and should see your source.

Snappy Cracker
  • 1,393
  • 12
  • 14
  • I ran into the exact same issue as the OP and this solution worked. I suspect that it was something related to corrupted Visual Studio Settings, and changing the theme fixed the issue by recreating the settings file. Essentially, this is like a less destructive form or resetting Visual Studio settings, as it preserved all of my existing settings. – Joseph Ferris Nov 28 '17 at 19:50
  • 1
    Or rather in VS 2015, Tools -> Options -> Environment -> Fonts and Colors. For me the foreground/background was already set to what it should have been, but I clicked OK and restarted regardless and then restarted, and the display was then visible. – AndyUK Apr 04 '18 at 11:06
  • Same for me, for me I guess it is a Windows automatic update the cause of it, as it restarted my computer by night, and VS was opened. – Siegfried.V Nov 15 '18 at 04:28
1

Please clear Visual Studio Cache, then open the Visual Studio again. You can find cache folder on follwing path

C:\Users\<your_username>\AppData\Local\Microsoft\VisualStudio\<VS_version>\ComponentModelCache

Note : Close Visual Studio, and stop all Visual Studio processes.

Joe
  • 40
  • 1
  • 8