Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft Visual Studio 2012 cannot set breakpoint in c# file

I have Microsoft Visual Studio Professional 2012 installed, version 11.0.60610.01 Update 3.

When debugging a c# (.cs) file Visual Studio gives me the following message when I try to set a breakpoint:

"A breakpoint could not be inserted at this location".

I get this message even when trying to set it on a line within a method. But in a .vb file for a Visual Basic app, I can set a breakpoint.

I am wondering if anyone has any suggestions to resolve this or if I need to reinstall visual studio.

Thanks

like image 275
user1408767 Avatar asked Sep 25 '13 13:09

user1408767


People also ask

Why my breakpoints are not working?

If a source file has changed and the source no longer matches the code you're debugging, the debugger won't set breakpoints in the code by default. Normally, this problem happens when a source file is changed, but the source code wasn't rebuilt. To fix this issue, rebuild the project.

How do I fix breakpoint in Visual Studio?

To set a breakpoint in source code: Click in the far left margin next to a line of code. You can also select the line and press F9, select Debug > Toggle Breakpoint, or right-click and select Breakpoint > Insert breakpoint. The breakpoint appears as a red dot in the left margin.

How do I Debug C in Visual Studio?

To do that, open C++ file in VSCode and either hit F5 or go to Debug -> Start Debugging and select C++ (GDB/LLDB) then select g++.exe build and debug active file . Notice that I've added one more optional configuration g++ build & run active file in launch. json and g++ build & run in tasks.


1 Answers

Maybe I'm too late for this question but here it goes anyway,

  1. BUILD > Clean Solution
  2. BUILD > Build Solution
like image 69
Kup Avatar answered Sep 28 '22 13:09

Kup