简体   繁体   中英

Is there a keyboard shortcut to evaluate an expression in the Watch window in Visual Studio?

If you use a method call in an expression in the Watch Window, Visual Studio does not constantly evaluate the expression all the time and instead says

This expression causes side effects and will not be evaluated

I appreciate the necessity for this, but every time that I do want to evaluate the expression, the only ways I've found so far are:

  • Click the re-evaluate button — requires grabbing the mouse, yuck
  • Edit the expression by adding a trailing space — clunky workaround

I already looked through the list of commands that I can assign keyboard shortcuts to, and the only relevant I found is Debug.EvaluateStatement , which sounds like it's exactly what I need, but it doesn't appear to have any effect.

Is there a keyboard-assignable command to evaluate expressions in the Watch window?

The keyboard shortcut required is Space . It is not a customisable command though.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM