Visual Studio - some breakpoints that don't break

I have a solution in Visual Studio 2010 with 9 projects that are under source control with Source Safe. I recently spent my hard drive and upgraded to Win7 x64 from WinXP x86 (long overdue!). When I checked the solution on a "new" machine, some parts do not work correctly, so I'm trying to debug it.

It may be worth noting that I used to work in VS2008. When I upgraded, I first opened the project in VS2008 to make sure that it worked, and I noticed that there were problems that I needed to debug. I set some breakpoints, but the pair worked, but the pair didn’t. I could not immediately understand why some of them do not break, so I decided to continue and upgrade the project to VS2010, hoping that it would work on its own. This is not true.

The main project calls a public element in an open module in the project, which is the library referenced by all other projects. I have a breakpoint on the main Form_Load form, which breaks successfully as soon as the code starts working. Form_Load calls the aforementioned public node, which also has a breakpoint. But this breakpoint does NOT break. In other words, the debugger stops at the call ProjectStartupActions(), but does not stop at the definition Public Sub ProjectStartupActions()or any line in it.

If I “Go To Definition” on the subtitle in Form_Load, it jumps to the right place where I have a breakpoint, so I'm sure I set the breakpoint correctly.

My Project → Debug → The configuration is configured to "Active (Debug)", and the platform is "Active (Any CPU)" for all projects. To confirm once again that it should work in Debug, and not Release, if I open the Explorer window in the Debug folder for the library project and clear the project, the folder will disappear. When I rebuild or run files, they are all replaced.

Thanks for any help.

Oh yes, I also made changes to the code Public Sub ProjectStartupActions(). I added MsgBox("Hello")to the first line in sub, but never appears.

+3
source share
2 answers

Set a target for x86 to debug it. - Hans Passant

It worked! Thank you !! I used Configuration Manager to change the goal for the whole x86 solution.

? " " , ?

+2

, Public Sub ProjectStartupActions(). MsgBox("Hello") sub, .

, . , , ProjectStartupActions() ( - ).

, VS, , .

/, . / , .

0

Source: https://habr.com/ru/post/1786222/


All Articles