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 7678997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:46:31+00:00 2026-05-31T17:46:31+00:00

I often use the Watch Window in Visual Studio for debugging. But it requires

  • 0

I often use the Watch Window in Visual Studio for debugging. But it requires you put all of your code into a single statement (without a semi-colon) to get the result. Is there a way I can use existing variables (that are in scope) and write a code block (multiple lines of code) and test it inline while I’m debugging?


Answer until Microsoft makes an enhancement:
No, this is not possible I guess–having multiple lines (code block) run during debugging.

  • 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-31T17:46:32+00:00Added an answer on May 31, 2026 at 5:46 pm

    Yes, you can use Immediate Window for such purposes.

    So, for instance when the program execution is stopped on a break point and you want to see state of a variable in the current execution scope or even evaluate deffered LINQ query. Just type in variable name and press ENTER – variable’s value will be printed out. To evaluate LINQ query I’m using ToList() and then indexer to acces any particular item, for instance you’ve such a query:

    var items = input.Where(i => i.SomeCondition).Take(2);
    

    Now just dorp this in Immediate Window:

    // Count of the items will be printed
    items.ToList().Count()
    
    // see first element, element type/name/value/properties/etc will be printed
    items.ToList()[0]
    

    Important: you can evaluate only single line of code at the time.

    More advanced usage: Immediate Window Commands

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

Sidebar

Related Questions

I often use to memorize all matrixes in a single vector, because my book
I often use visual studio 2005 side-by-side with visual studio 2008. Do you remember
I often use the execv() function in C++, but if some of the arguments
I often use this code pattern: while(true) { //do something if(<some condition>) { break;
I often use the website www.cplusplus.com as a reference when writing C code. I
i often use but i have this problem. if there is a whose action
I often use this code or a form of this code throughout OnClicks and
I often use * to highlight all instances of the current word, and the
We often use stacks or queues in our algorithms, but are there any cases
I often use THEAD, TBODY, and TFOOT elements to divide my data tables into

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.