Link to home
Start Free TrialLog in
Avatar of sphairos
sphairosFlag for New Caledonia

asked on

My plugin doesn't stop on Beakpoints

Hi guys,

I'm seeing strange behaviour with a plugin for Readsoft that I'm developing.

I want it to stop on a breakpoint but it doesn't. The msgbox just before the place I put the breakpoint is displaying correctly, and the one right after it too.

I need your help because I don't have any clue of what the problem is.

Thanks for your help!

PS : I'm using Visual Studio 2010 Professional, coding in VB.NET
Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada image

In order for a breakpoint trigger, the Generate debug info option should be activated for the configuration you are working with (the Debug / Release ComboBox) in the Advanced Compiler Settings of the Compile tab of the project's properties window. In most cases, it should be set to pdb-only for the Debug configuration and to None for the Release version.

Be careful, because there are 2 comboboxes listing the configuration. The one in the toolbar is use to define which one you want to compile and/or run. The one at the top of the Compile tab defines which of the configuration you are settings the option for.
Avatar of sphairos

ASKER

Thanks for your answer.

Actually it is on Debug mode that's why I don't have any clue on how to get my debugger working.

Maybe if I explain my config better it will help :

here is the class with the breakpoint I want to stop to

here is the properties file that launch the ReadSoft programm it is going to run into

here is the ReadSoft programm with the Msgbox displayed after the breakpoint line where debug didn't stop

Hope this help, I'm really stuck
From what I see, your problem occurs before Connect is called. I do not see the code that displays the MessageBox, so no way to know what could happen.

Might well be that Connect is not called at at.

I would put a MessageBox at the beginning of Connect. It that one does not show, then it means that Connect is never called, and the problem is not with your breakpoint, but with the code that calls Connect.

Your code looks like mine. Commentaires en français mais variables, méthodes et classes in English :-)

It's not the fact that you are in Debug that triggers breakpoints, it is the way the Debug configuration is set in the project's properties Window. Have you checked the Generate debug info I was mentioning in my first answer?

I have a feeling that you might not work much with the project's properties. Do you know that you can set the options there for all the project instead of having to set them at the top of each file?

And if I were you, I would set Option Strict On. It will force you to look at your code more closely and can prevent a lot of hard to find bugs.
I'm sorry I'm so unclear...

In fact it goes well through the connect() function the msgbox was in the first line of the connect() function and was displaying well even if I put a breakpoint on it, it displays the msgbox without stoping.

You right I don't know much of how to use project's properties (I'm used to develop in ASP.NET which is quite different)

I have a feeling that you might not work much with the project's properties. Do you know that you can set the options there for all the project instead of having to set them at the top of each file?
So how?

It's not my code (an ex collegue did this before me :) )
OK. In the Project menu, usually the last entry in the menu, you have the project's properties. This is where you set most of the compiler and debugger options as well as a few other things. If you are to go on with Windows Application development, I suggest that you spend some time to explore that. F1 from any of the tabs gives you a good overview of what everything is about.

For your problem, here is a possible cause.

Open the project's properties window as describe earlier.

Go into the Compile tab.

In the Configuration drop down at the top, select Debug, since this is the configuration in which you want the debugger to be active.

Under the Advanced Compile Options button, in the same tab, there is a setting to Generate debug info. This should not be set to None. Pdb-only is usually sufficient when programming in VB. This enables the debugger to link the compiled code with the source code, so it is able to break when needed in the .exe, and bring you to the correct source code line when there is an exception.

The code not being executed or the pdb not being generated are the 2 main causes of breakpoints not being activated.

If this does not solve your problem, a little question. Does the sphere indicating a breakpoint stays red while the application is running in Visual Studio, or does is turn to an empty circle.
Ok thanks for the precious informations.

So to answer you the sphere is still full it doesn't come empty I guess it is a good clue for you? :)

Here is my Advanced Complier Settings window. The "Generate debug info" was on "Full" before
ASKER CERTIFIED SOLUTION
Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ok you guessed well!

It was a problem of .NET framework!

Thanks a lot for your patience and your help!