Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 325001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:10:33+00:00 2026-05-12T09:10:33+00:00

Is there a way in Visual Studio (2008 if it matters) that I can,

  • 0

Is there a way in Visual Studio (2008 if it matters) that I can, in debug/break mode, write the contents of a variable to a text/XML file?

The scenario is that I have a long process running in debug and I have realised too late that I haven’t logged enough detail about the events that the process has been monitoring, but fortunately a history is still available within a variable in the code.

I could trawl through the tens of thousands of items in this list, but it’s not going to persist once I hit stop on the application … there is no obvious context option for this, but is there any way, a better way than manual? Or is there no hope and I just need to hit stop, re-tool the logging function and run the thing again?

Aside from trying to hit a breakpoint, modify the code and re-write to make a better logger, is there a way of not losing that in-memory data?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T09:10:33+00:00Added an answer on May 12, 2026 at 9:10 am

    One way to do it would be to use the immediate window (menu Debug -> Windows -> Immediate). In the window that appears you can use the "?" to query the value of a variable.

    Assuming your history variable is a string you view its contents by typing the following in the immediate window:

    ?history
    

    You could copy and paste the output from there into a text file or alternatively ask Visual Studio to log all command window output. To do this type:

    >log "c:\test.log"
    >? history
    >log off
    

    Log is an alias for Tools.LogCommandWindowOutput and accepts the following parameters:

    Tools.LogCommandWindowOutput [filename] [/on|/off] [/overwrite]
    

    Check out the MSDN article Log Command Window Output Command for more information.
     

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way that I can configure Visual Studio 2008 to understand CamelCase?
Is there a way to have Visual Studio 2008 automatically add heading information to
Is there any way to make Visual Studio 2008 Express store all the files
In Visual Studio 2008, is there a way to keep the indentation of automatically
We have tremendous problems with Visual Studio (2008, if that matters) locking up and
Is there a way in Visual Studio 2008 to go from a closing brace
Is there any way in Visual Studio 2008 to smoothly switch between using Emacs
Is there any way to create a Windows Installer using Visual Studio 2008 to
Is there a way in Visual Studio (a hotkey) to automatically import a type
Is there any way to prevent Visual Studio from creating a VSMacros80 folder in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.