• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2256
  • Last Modified:

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

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
darbid73
Asked:
darbid73
  • 7
  • 4
  • 2
2 Solutions
 
nffvrxqgrcfqvvcCommented:

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
 
darbid73Author Commented:
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
 
nffvrxqgrcfqvvcCommented:
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
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

 
darbid73Author Commented:
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
 
darbid73Author Commented:
I hit the submit too quick.



New-Picture--2-.bmp
New-Picture--4-.bmp
0
 
ZhaolaiCommented:
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
 
darbid73Author Commented:
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
 
ZhaolaiCommented:
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
 
darbid73Author Commented:
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
 
ZhaolaiCommented:
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
 
darbid73Author Commented:
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
 
ZhaolaiCommented:
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
 
darbid73Author Commented:
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 7
  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now