A core feature of Visual Studio that allows developers to inspect, analyze, and troubleshoot code during execution.
For this scenario, the most useful diagnostics are the module load state, symbol load state, source/PDB match state, and the exact code type Visual Studio is attaching for the process.
Collect this information while debugging:
- Check whether the affected C++/CLI module is actually loaded
- Start debugging.
- Open Debug > Windows > Modules.
- Find the DLL for the C++/CLI managed layer whose breakpoints do not bind.
- Confirm whether the module appears at all.
- If the module is not loaded, the breakpoint cannot bind.
- If it is loaded, the next step is symbol status.
- Check the module’s symbol status
- In the Modules window, inspect the Symbol Status column for that C++/CLI DLL.
- If symbols are not loaded, right-click the module and select Symbol Load Information....
- The exact Symbol Status shown for the module.
- The output from Symbol Load Information....
- Verify Visual Studio is debugging the correct process and code type
- Open Debug > Windows > Processes.
- Confirm the debugger is attached to the correct process.
- In the same window, check what type of code the debugger is configured to debug.
- Whether Visual Studio is attached to the wrong process.
- Whether the debugger is configured for the appropriate code type.
- Check whether the source file matches the built binary
If the breakpoint tooltip says the current source differs from the built version, rebuild the project.
- Save the source again if needed.
- If Visual Studio thinks the project is up to date, do a clean build and then rebuild.
- The exact breakpoint tooltip text.
- Whether a rebuild changes the breakpoint from hollow to solid.
- Confirm the PDB contains source information
If symbols are loaded but breakpoints still do not bind, one documented cause is that the PDB does not contain source file information. Relevant checks:
- Confirm the loaded module is the current build.
- Confirm a full PDB is being used and not a stripped PDB created with /PDBSTRIPPED.
- If the PDB may be corrupted, delete it and perform a clean build.
- Compare the working and non-working C++/CLI layers in Modules
Since one managed layer binds correctly and the other does not, compare these side by side in Debug > Windows > Modules:
- Whether both DLLs are loaded
- Symbol Status for each
- Whether one shows symbols loaded and the other does not
- For remote-style symbol issues or mixed deployments If the wrong binary is deployed or a release binary is being used, symbols may not load correctly and the module may not be treated as expected for user code. The documented guidance is to verify the debugger is using the exact matching PDB created when the app was built.
What to provide for diagnosis:
- Screenshot or text from Debug > Windows > Modules for both the working and failing C++/CLI DLLs
- The Symbol Status for the failing module
- The full Symbol Load Information... output for the failing module
- Whether the failing module appears in Modules at all
- Screenshot or details from Debug > Windows > Processes showing the attached process and code type
- The exact breakpoint tooltip/warning text
- Whether a Clean + Rebuild changes behavior
- Whether the failing project may be producing a stripped PDB
- Whether the source file was recently changed without rebuilding
If the breakpoint warning is specifically:
- “No Symbols have been loaded for this document”: focus on Modules and Symbol Load Information....
- “the current source code is different from the version built into...”: focus on rebuild/clean and source-binary mismatch.
Visual Studio breakpoint state meanings are also useful during diagnosis:
- Solid red circle: breakpoint successfully set.
- Hollow circle: breakpoint is disabled or a warning occurred while setting it.
- Exclamation glyph: the debug engine handled the breakpoint but could not bind it as an error.
- Question glyph: the debug engine returned a warning because another debug engine might still bind it.
References: