|
-
Aug 17th, 2016, 12:22 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] Debug.Print not showing in Immediate window
I can't seem to figure out why the results of my Debug.Print statements don't appear in the Immediate window when I'm in Debug mode (single stepping through my code after compiling to the /Bin/Debug folder).
This should be simple, but I need some help. Appreciate any help on how to do this.
-
Aug 17th, 2016, 12:39 PM
#2
Re: Debug.Print not showing in Immediate window
They go to the Output Window, by default.
If you want them to go to the Immediate Window, you have to choose that option. Probably from the Tools/Option/Debugging menu, but I'll have to track down exactly where. You might find it before me.
5 minutes later (had to launch the IDE): It's about the 7th option from the bottom of the list on the Tools/Options/Debugging/General list.
"Redirect all Output Window text to the Immediate Window".
But if you like to type things into your Immediate Window to examine and try things out, you might not want other debugging output going to that window as well, so keeping the rest of the Output stuff going to the Output window is usually desirable.
Last edited by passel; Aug 17th, 2016 at 12:46 PM.
-
Aug 17th, 2016, 01:08 PM
#3
Thread Starter
Fanatic Member
Re: Debug.Print not showing in Immediate window
Hi passel -
Yes, my IDE has that option already checked. There must be something else that I'm missing. Thoughts?...
-
Aug 17th, 2016, 08:35 PM
#4
Re: Debug.Print not showing in Immediate window
Have you verified that it is still going to the Output window, or is it Lost?
At the top of the Output window there is a selection of what Output your seeing, e.g. Build or Debug. Is Debug selected.
Changing the option I mentioned in post #2 seems to be an involved reconfiguration of the IDE, as it can appear to hang for some number of seconds when switching the option.
I guess I would try deselecting the redirect output option, wait for the IDE to reconfigure itself (might take 10 seconds or so), and then run a program to verify if Debug.Print and/or Debug.WriteLine writes to the Output window.
Then try checking the option to redirect to the immediate window again and wait as it reconfigures, then run and test to see if it now goes to the immediate window or still goes to the output window, or is lost altogether.
-
Aug 18th, 2016, 01:48 AM
#5
Re: Debug.Print not showing in Immediate window
They go to the Output Window, by default.
Debug.Print has always gone to my Immediate window by Default, versions 2003, 2005, 2010. Maybe it's different in the newer versions but I've never had to set that Option.
-
Aug 18th, 2016, 02:07 AM
#6
Re: Debug.Print not showing in Immediate window
 Originally Posted by wes4dbt
Debug.Print has always gone to my Immediate window by Default, versions 2003, 2005, 2010. Maybe it's different in the newer versions but I've never had to set that Option.
It might depend on the way you set up your IDE. It may be that it is different between choosing VB Developer and General Developer when you first run VS. I've always seen Debug output in the Output window and I always choose General Developer.
-
Aug 20th, 2016, 12:22 PM
#7
Thread Starter
Fanatic Member
Re: Debug.Print not showing in Immediate window
Found the answer . In the "Compile" section of my project properties there is an "Advanced Compile Options..." button. Clicking this button opens the "Advanced Compiler Settings" window. In this window there is a "Compilation Constants" section that has a "Define DEBUG constant" checkbox.

I did not have this checkbox checked. When it is checked, then my Debug.Print statements output to the Immediate window of the IDE.
-
Aug 20th, 2016, 10:45 PM
#8
Re: [RESOLVED] Debug.Print not showing in Immediate window
What build configuration are you running? That DEBUG constant is defined by default for Debug but not for Release. You're not running a Release build in the debugger are you? It's generally bad form to define the DEBUG constant for the Release configuration because it makes your released executable less efficient.
-
Aug 21st, 2016, 06:18 AM
#9
Thread Starter
Fanatic Member
Re: [RESOLVED] Debug.Print not showing in Immediate window
My Release build configuration does not have the "Define DEBUG constant" checked.
I don't know why it was unchecked in my Debug build configuration.
Visual Studio has a lot of configuration parameters. I admittedly am not an expert on most of them .
Now, if I could just figure out why I have to delete my Bin folder between compiling my code (to avoid the "cannot copy the .exe file from obj\x86\Debug folder to \bin folder" error)...but that's for another day and other postings:
http://www.vbforums.com/showthread.p...+%5Cbin+folder
http://www.vbforums.com/showthread.p...t=#post5018697
http://www.vbforums.com/showthread.p...community+2015
Last edited by Mark@SF; Aug 21st, 2016 at 11:24 AM.
-
Aug 21st, 2016, 03:19 PM
#10
Re: [RESOLVED] Debug.Print not showing in Immediate window
Code:
Now, if I could just figure out why I have to delete my Bin folder between compiling my code (to avoid the "cannot copy the .exe file from obj\x86\Debug folder to \bin folder" error)...but that's for another day and other postings:
I see you have a link to my post on this subject. Unfortunately I've never been able to solve the problem, I hope you have better luck. You might try creating a new project and add your code using "Add Existing Item". If your project isn't huge, it shouldn't take long. A better than closing and restarting the project each time you want to compile.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|