I keep getting the following when trying to step through code and use the Immediate Window or Watch Window in Visual Studio.
Unable to Evaluate the Expression
I'm using Visual Studio 2008. Searching the forums there is a lot of talk of using the overloaded Response.Redirect and passing false to the endResponse parameter. I have tried that
I have also checked that my code is running the debug version and not the complied version.
I decided to start a brand new Windows Form Application with nothing on the form. In the Form Load event I declare a String and set a value to it. Stopping in there via a breakpoint I try and print the value of the String to the Immediate window and I still get 'Unable to Evaluate the Expression'
This has occurred all of a sudden. Regardless of any solution I open I am unable to use the Immediate window or watch windows to determine values in the code.
I'm not sure If a setting in Visual Studio has changed?
To open the Debug Console, use the Debug Console action at the top of the Debug pane or use the View: Debug Console command (Ctrl+Shift+Y). Expressions are evaluated after you press Enter and the Debug Console REPL shows suggestions as you type.
To end a debugging session in Microsoft Visual Studio, from the Debug menu, choose Stop Debugging.
Debugger not working Look at the debugger console for any error messages displayed. Look at the Debugger Tools console output for any errors. Remember to re-start VS Code once done (this won't be necessary in a future release). Solution: Clear all expressions from the debugger Watch window and start debugging again.
Tools -> Options -> Debugging -> General -> Enable Just My Code
If the option is not ticked, then I get "Unable to evaluate the expression".
If I tick the option AND restart visual studio (this is the crucial bit) it fixes the problem for me.
I had this issue with Visual Studio 2012, and fixed it just resetting settings: "Unable to evaluate the expression" in Visual Studio 2012 Debug Mode
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With