I am using Visual Studio 2013, .Net Framework 4.0, and C#.
I am trying to debug a file in my project. I have the project set to debug build in the project properties, with “optimize” unchecked. And yet, whenever I try to debug this project, it can’t load the symbols. So I go to the modules window to load the symbols, and the dll has “Optimized” column set to “Yes”, the “User Code” column set to “No”, and the message “Binary was not built with debug information” in the Symbol Status column.
I have cleaned and rebuilt, reset iis, and manually cleaned out the temporary asp.net files numerous times, with no avail.
Anybody know how to solve this?
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
If your project is already in Debug mode. Please check Advanced Build Settings Dialog Box in Build tab of project.
Make sure that Debug Info is not set to none

Reference:
Method 2
For Visual Studio 2017 for Configuration Release or Debug you can create a pdb file for debug information like this:
- Right click your project in Solution explorer and select “properties”
- Select “Configuration Properties”
- Select “Debugging”
- in “Generate Debug Info” select “Yes (/DEBUG)”
- in “Generate Program Database File” enter: $(OutDir)$(TargetName).pdb
Method 3
If you’re having this problem and none of the other answers here worked, check solution -> Properties-> Configuration and make sure that your project is set to debug.
Method 4
If you’re trying to debug native code (C++) from managed code (C#), make sure that your properties are set to Mixed instead of Native only.
- Right-click on your project and click Properties.
- Under the Debug tab, go to the Debugger type section and change the Application process to Mixed (Managed and Native).
(I followed the answer given here by Weston. Thanks Weston!)
Method 5
The dll you are trying to debug most probably is not being built in your solution. You need to locate where it is being built and obtain a debug version (or at least a release version with the pdb symbol file).
Method 6
For Visual Studio 2019,
Right click your project in Solution explorer and select “properties” -> Select Compile -> click Advanced Compile options -> Set Generate debug info to Full. Then clean solution and Rebuild solution.
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0