debugging information cannot be found or does not match visual studio's

You probably have deactivated the debugging information for your project:

  • Right click on your project -> Properties
  • Configuration properties -> Linker -> Debugging
  • Switch "Generate Debug Info" from No to Yes

Rebuild your project and retry, it should now run without the message :)


The main reason is that you don't have a matching pdb and exe.

Some possible solutions:

  • You are compiling in release instead of debug
  • You need to clean/build or rebuild
  • You don't have your pdb files being generated in the same directory as the exe
  • You have a mismatching pdb, maybe the copied source is newer than today's date and something isn't building properly.
  • Try cleaning out all debug object files
  • You are attaching to a process that you started from a different location from where your build exe and pdb exist
  • Restart Visual Studio

This happens to me every now and then, while debugging code and making changes it seems like visual studio caches the pdb information and sometimes it gets stuck. Doing a Rebuild solution, deleting the pdb and creating a new one doesn't fix the problem.

Of course I do have the generate debug information on and all that it's needed, specially since this happens while debugging the code several times.

Visual Studio seems to be happy with the in-memory pdb and refuses to update it, regardless of time-stamps or even size changes in the pdb.

The only way to reset this is to exit Visual Studio (the IDE) and restart it again.

In some rare occurrences, the IDE might be still running in the background (process explorer shows it there) and might hold the handle to the file open. You can kill the process before restarting the IDE.

Good Luck