提出问题提出问题
 

已答复debug and immediate window

  • 2009年11月6日 1:38TNTSoftware 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    I was running Visual Studio 2008 on my computer went through a whole VB progamming course with no problems. I recently had to have my computer hard drive erased and reloaded with windows xp to eliminate a virus. When I got it from the shop Visual Studio 2008 had not been backed up so I reinstalled the Professional edition from my disc. I opted fo the recommended installation. Every thing seems Ok except when I put a debug.Writelie (" Hello"}  in the code nothing appears in the immediate window when it is executed. If I go to the immediate window and type the same line and hit return the string appears in the immediate window. If I assign a value to a variable in the program and put the debug.writeline command in the code module nothing appears in the immediate window, but if I go to the immediate window and type debug. writeline (var) and hit return the value of var apppears in the immediate window. i  went to the debug menu and selected windows then clicked on immediate but it didn't highlight or show check mark. When the project builds after start debugging the immediate window appears. In the help it talks about a trace listener and insertig a line of code in the compile command line. I am not that experienced. Any help in solving this would be appreciated. Thank you
    Harry Nickerson

答案

  • 2009年11月6日 13:20Joao S Cardoso 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     已答复

    Something is not working properly because when you do a Debug.WriteLine("Something") it should com up on Immediate window.

    First things first.

    a) Go to menu Tools, then Options. Here make sure you have the "Show all settings" on the lower left side of the options screen selected.

    b ) Navigate to: Debugging -> General

    c) Make sure you have the option "Redirect all Output Window text to the Immediate Window"

    That should fixe it.

    To check it try this:

    - Create a new windows forms project
    - A Form1 will be created and displayed
    - Drag a button from the toolbox
    - Dbl click the button so you enter in de code window for the Click event.
    - Write the necessary code to have something like this:

        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Debug.WriteLine("teste")
        End Sub

    - Run the app
    - Press the button. Dont close the app anc check on VS.NET the Immediate window. See whats shown there.

    Let us know if this fixed the problem.

    Cheers


    Please remember to mark the replies as answers if they help you.

全部回复

  • 2009年11月6日 13:20Joao S Cardoso 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     已答复

    Something is not working properly because when you do a Debug.WriteLine("Something") it should com up on Immediate window.

    First things first.

    a) Go to menu Tools, then Options. Here make sure you have the "Show all settings" on the lower left side of the options screen selected.

    b ) Navigate to: Debugging -> General

    c) Make sure you have the option "Redirect all Output Window text to the Immediate Window"

    That should fixe it.

    To check it try this:

    - Create a new windows forms project
    - A Form1 will be created and displayed
    - Drag a button from the toolbox
    - Dbl click the button so you enter in de code window for the Click event.
    - Write the necessary code to have something like this:

        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Debug.WriteLine("teste")
        End Sub

    - Run the app
    - Press the button. Dont close the app anc check on VS.NET the Immediate window. See whats shown there.

    Let us know if this fixed the problem.

    Cheers


    Please remember to mark the replies as answers if they help you.
  • 2009年11月6日 21:37TNTSoftware 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    Joao, You were exactly right. That fixed my problem. I was not aware of all the sub-menus on the settings page. Thank you so much for reading and answering my problem.
    Harry Nickerson