13

I am using Visual Studio 2013 and I am facing a weird issue from last few days. Whenever I try to set a break point, I get an error

"The Following breakpoint cannot be set", "The breakpoint failed to bind".

I don't know what settings have changed.

Screenshot of Visual Studio error dialog

David Gardiner
  • 16,892
  • 20
  • 80
  • 117
rahul.deshmukh
  • 580
  • 2
  • 6
  • 23
  • If everything else fails, maybe start a project from scratch, import all source files, and check if you have the same problem. – TobiMcNamobi Dec 10 '14 at 14:27
  • i check the same even i tried to open same project in other version of visual studio i.1. visual studio 2012 but its giving me same problem – rahul.deshmukh Dec 10 '14 at 14:55
  • Try to remove code until you have a smaller [example](http://stackoverflow.com/help/mcve), post that here, so others may reproduce this behaviour. – TobiMcNamobi Dec 10 '14 at 15:03
  • Was this local debugging or remote debugging? I had this happen with remote, and I just had to republish, and make sure the latest pdb was in the bin folder with the publish. – Matt Healey Jun 23 '15 at 17:53
  • Possible duplicate of [Breakpoint Failed to Bind - Visual Studio 2015](http://stackoverflow.com/questions/31732944/breakpoint-failed-to-bind-visual-studio-2015) – Michael Freidgeim Jun 22 '16 at 01:19

9 Answers9

26

I don't know if you resolved your issue but I faced the same problem and the "solution" was to change from "Release" configuration to "Debug".

Hope this Helps.

Cheers

Dreeco
  • 290
  • 4
  • 10
7

I used a MVC project and couldn't set any Breakpoints in the Razor-View.
All my projects were build in Debug-mode and a clean+rebuild didn't help either.
I had to remove this entry:

<configuration>
    <appSettings>
        <add key="Microsoft.VisualStudio.Enterprise.AspNetHelper.VsInstrLocation" value="C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Performance Tools\vsinstr.exe"/>
    </appSettings>
</configuration>

in the Web.config and breakpoints worked again.


I found a related thread: Visual Studio 2013/2015 profiler adds Not publishable lines in web.config? Seems to be a Bug

Community
  • 1
  • 1
user5997884
  • 157
  • 1
  • 9
  • Perfect! Thanks! However, I had another thing which silently interferred and that was Python tools for performance testing in VS. I had to additionally remove it too, so if anybody have this issue consider that as well. – Syed Nov 08 '16 at 09:26
0

I had the same problem and I've fixed it by creating a new solution file to the project files.

Fabio Belz
  • 258
  • 2
  • 6
  • 12
0

Check your program for subtle bugs. My failure chain that caused this error was:

  1. I inadvertently put a duplicate key/value pair in App.config
  2. Code that read that key/value via the ConfigurationManager silently failed
  3. Structs returned by that code were invalid
  4. Breakpoints on any line that referenced the invalid structs failed to bind

Once I fixed Item 1, everything started working again.

kismert
  • 1,662
  • 1
  • 13
  • 19
0

I had the same problem with Python code. Everything was ok, but

"The breakpoint failed to bind"

If the line number (where is the breakpoint set) is greater then 512, than you can't debug. I simply reorganized my code, to be earlier that part with breakpoint and magically debugging is working again...

At this link you can find a full answer (at final rows):http://pytools.codeplex.com/workitem/3007. So this is fixed in last version of Python Tools, but that version (2.2) works with VS2015 only.

0

In my case, this was caused by a faulty merge of the .csproj contents, to be specific a ItemGroup contained a node which belonged in its own ItemGroup.

Josef
  • 2,869
  • 2
  • 22
  • 23
0

I just encountered this myself.

To my surprise, I didn't observe I had a syntax error in a line further above.

With that one syntax error, it was causling the Studio 2019 IDE to fail in allowing me to set a break point anywhere.

So do double check if that's the case.

Tim Miltz
  • 41
  • 2
0

There could also be another open app that steals the "F9" shortcut.

Check your systray for open apps ;)

Cătălin Rădoi
  • 1,804
  • 23
  • 43
0

Problem:
In VS2022 you can't set a BreakPoint on a variable declaration without an assignment.

Solution:
Set a BreakPoint on a variable declaration with an assignment or another line that is executable.

Jeremy Thompson
  • 61,933
  • 36
  • 195
  • 321