C# VS2010 Entering break mode failed

大兔子大兔子 提交于 2019-11-30 02:52:54
AMissico

Delete the solution user options (.suo) file.

If you experience "funny" debugging issues, it usually means the suo file is corrupt.

Delete the solutions suo file. This has fixed weird debugging problems with breakpoints every time for me. Note, you will lose your solution settings, such as bookmarks, breakpoints, and such.

See Visual Studio 2008 - The breakpoint cannot be hit.

Visual Studio 2012 Update 3

Didn't work:

  • Rebuild Solution
  • delete .SUO
  • Delete Obj and Bin directories

Did work:

Tools->Options->Debugging->Edit and Continue->uncheck Edit and Continue checkbox

Tried this, but it didnt work. For me in the end solved:

Build > Clean Solution Build > Build Solution (F6)

I had this on a set of solutions we started to maintain for a client and migrated to Visual Studio 2010. The "delete the .suo file" did not work.

Somehow the set of sources included two assembly projects into the same directory, sharing one source file file. That file itself was not in the warning dialog.

This solved the problem:

  1. split the assembly projects in separate directories, and
  2. move the shared file into a 3rd assembly (also in a separate directory).

The solution for me was a little more esoteric to say the least! I had a workflow.xaml in an Azure WorkerRole project and it was set to BuildAction: XamlAppDef instead of None. For some reason, this caused the project to fail to pick up any changes to other files - even though VS2013 reported a successful build - which resulted in the "Entering break mode failed" error when attempting to debug the WorkerRole.

Other symptoms included types not being recognized (i.e. coloured by the IDE) and intellisense not working. Setting the xaml file build action to "none" fixed the problem (I dynamically load the workflow in any case).

I mention this just in case someone else has done something similar and the other solutions do not work.

I had a library project A and a web project in my solution. Needed to add a project reference of project B to library project A for debugging. Did that but it wouldn't work.

Problem was that the web project was also referencing project B via DLL; so I also needed to change that to a project reference as well and then it worked.

For me, selecting Project|Add Existing Item, and then selecting the file named in the error message worked.

I had the same issue when I was trying to copy over a project that was not in source control.

The solution to the problem was that the bin directory was marked as read only (must have happened during the copy) and as a result the project was running on libraries built on a different host and it was unable to step through.

Make sure you manually delete all items in the bin directory and make sure the 'bin' directory can be written to.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!