This is due the pdb file is not included in the compilation. If you're compiling in a solution configuration other than debug you must ensure that pdb is included.
To achieve that you must open the advanced build setting:
- Right click on project and select properties
- Click on build tab
- Check that your configuration is selected in the "Configuration" dropdown
- Click on advanced button.
In the new window you must select "pdb-only" in the debug info dropdown.