Solved

VS2010 - edit while debugging - output to immediate window eg debug.print

Posted on 2010-09-06
13
2,231 Views
Last Modified: 2013-11-27
I just installed VS2010 Express - the free version.  I have played around with other versions that are not free.

2 things I cannot work out is;

1. Outputting the Debug.print things to the immediate window.

Tools > Options > Debugging > General > Redirect All Output Window Text to the Immediate Window (is CHECKED)

2.  During debugging I cannot change anything at all.

On other versions I could make certain changes to things while debugging.  In this version of VS I get an "Edit and Continue" titled window with -

Changes are not allowed in the following cases
 - When the debugger has been attached to an already running process
 - The code being debugged was optimized at build or runtime
 - The assembly being debugged is loaded as domain neutral
 - The assembly being loaded was loaded through reflection

By default the other Versions would allow this.  I could have even been working on the same code.

I am a VB.net / VS learner.




0
Comment
Question by:darbid73
  • 7
  • 4
  • 2
13 Comments
 
LVL 29

Assisted Solution

by:nffvrxqgrcfqvvc
nffvrxqgrcfqvvc earned 200 total points
ID: 33611047

I wonder if your looking at the Console Window and not the Immediate window.
I don't think the immediate window is automatically displayed when you first install VS2010 it's something you need to setup.
Press CTRL + G when your project isn't debugging.
Press CTRL + G while your project is debugging.

This should give you the Immediate Window for both
 
0
 
LVL 19

Author Comment

by:darbid73
ID: 33611170
Hi egl1044.  I am looking at the immediate window.  All that I am getting in it is for example this.  If I break immediately before a debug.print and then F8 it just jumps over the debug.print totally.

Step into: Stepping over non-user code 'System.Threading.Thread.CurrentThread.get'
0
 
LVL 29

Expert Comment

by:nffvrxqgrcfqvvc
ID: 33611400
I reset my settings mind you I am using the retial version and what you describe is already set to the default behavior.
You are pressing F8 multiple times to step into and over the Debug Print to the next line correct?
Here is the default settings for the retail version, maybe you can match them up to see if anything is missing.


firstsettings.png
secondsettings.png
debug.png
0
 
LVL 19

Author Comment

by:darbid73
ID: 33611567
Great Effort there.  There is one difference with what you have checked - I dont have break all processes when one process breaks.



New-Picture-3-.bmp
0
 
LVL 19

Author Comment

by:darbid73
ID: 33611621
I hit the submit too quick.



New-Picture--2-.bmp
New-Picture--4-.bmp
0
 
LVL 17

Expert Comment

by:Zhaolai
ID: 33612327
Are you running in Release mode? If so, change it to Debug mode. Then you will see the output. See screen shot below:

Screenshot.PNG
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 19

Author Comment

by:darbid73
ID: 33624707
As per usual it is USER fault.  I have done something to the project I am working on.  I just dont know what.

I set up a new blank VB windows forms project and both editing and debug.print worked fine.

I would love to know what I have done to my current project to do this.

The first thing that I have noticed is - Zhaolai - I dont have the dropdown box in my tool bar what it is called so that I can find it in the huge number of things I can add to a tool bar.

Under Project > Properties > Compile > Configuration = "Active (release)"
Under Project > Properties > Debug > Configuration = "Active (release)"

The thing is if I change this to "Debug" and then close and reopen the Properties page it is back to Active (release).

I am also targeting 3.5 which I have seen caused at least the Beta of VS 2010 problems. I am not using x64
0
 
LVL 17

Expert Comment

by:Zhaolai
ID: 33627413
Apparently you are using VB 2010 Express. Not sure if it's available in that version (I am using Pro version). See the screen shot below. The box is called Solution Configuration. If you see it, check it, and then change it to Debug.


Screenshot.PNG
0
 
LVL 19

Author Comment

by:darbid73
ID: 33634662
In that view it is not there.

But when you go Tools > Customize > Toolbar (checked) > Standard (choose) > Add Command (Btn)

Then you get a windows with 2 choices - Under Categories which one has Solution Configurations as a command.
0
 
LVL 17

Accepted Solution

by:
Zhaolai earned 300 total points
ID: 33637571
This is a bit strange...
I just downloaded/installed vb 2010 express, and have no problem with debugging/editing. What I can recommend is to reset the settings by Tools->Settings->Reset... and see if it helps.

Or just create a new project and add all your current project files, since you said that there is no problem with a blank project.
0
 
LVL 19

Author Comment

by:darbid73
ID: 33637649
yeh thats what I have done, I put that above.

I am just need my solutions configurations command and then I am done with this question.
0
 
LVL 17

Expert Comment

by:Zhaolai
ID: 33638254
Here is the solution for you:
1. Tools->Settings->Expert Settings...
2. Tools - options ->Projects and Solutions ->General, Check "Show advanced build configurations"
3. Tools->Customize..., Under Toolbars tab, check Build. Then on Commands tab, click on Toolbar radio button, "Build" should be shown in the dropdown box. Click on Add Command..., under Categories, "Build" should be highlighted. Then on the right box, scroll down  and click on Solution Configurations and then OK.

Screenshot.PNG
0
 
LVL 19

Author Comment

by:darbid73
ID: 33659838
I dont have the "Build" category so I imagine it is not available for the Express.

The solution to my problem is that I made a new project, made new objects and cut and copied the code.  Then debugging and the debug.print and editing worked fine.

There are some good suggestions above on how to make sure that what I have done is the only thing left to do.

Guys due to the effort put in I will split the points.  I hope that is ok.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now