Link to home
Start Free TrialLog in
Avatar of ugeb
ugebFlag for United States of America

asked on

visual studio won't stop on debug.print statement

Hi,

When debugging a small program I downloaded (Net DDE) I can't seem to get any debug.print outputs.  I'm more accustomed to VBA, and I'm not sure of the difference between a write and print, but neither prints to the immediate window.

I've selected the Tools / Options / Debugging / General / Redirect all Output  option, but nothing shows up.

Additionally, when I put a breakpoint on a debug.print line and start debugging, it actually MOVES the breakpoint to the next line!  I don't understand this behavior, but I guess it's some setting.  Under my project properties, in the Debug tab on the left, I selected the 'Debug' configuration.  Still didn't work.

What can I do?

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Anthony Berenguel
Anthony Berenguel
Flag of United States of America 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
Avatar of kaufmed
Go to the project's properties page (Project->XXX Properties). Ensure that the "Define DEBUG constant" on the Build tab is checked.

User generated image
Avatar of ugeb

ASKER

Wow, three different places to  choose between release and debug ...  That last one was the clincher.

@kaufmed, my properties page looks different from yours.  Instead of 'Build', I have 'compile', and I couldn't even find the 'Define DEBUG CONSTANT'.  Are you using a different version of VS? I'm using VS 2010 Ultimate.

Thanks!
What kind of project do you have? Is it a web site project?

In any event, if you didn't change any of the default settings, then setting the configuration mode as aebea suggested will have that setting enabled anyway.
Avatar of ugeb

ASKER

No, it's not a website project, but yes, aebea's suggestion did finally let me see the output.
OK, your question was for VB. The screens are slightly different between C# (what I posted) and VB. For VB it's the "Compile" tab under the "Advanced Compile Options" button:

User generated image
Avatar of ugeb

ASKER

Okay, good to know, thank you.