VS 2019 Debugger returns Unable to perform function evaluation on the process being debugged error on any Watch.

Paul Sander 1 Reputation point
2022-02-03T19:22:23.807+00:00

I'm attempting to debug a VB function in a Winform app with VS2019 in a project that was recently migrated from VS2010. I had no problems with Watches in VS2010 - the problem has only cropped up since upgrading to VS2019. I get the following on anything that isn't a static variable:

171070-image.png

Any feedback would be appreciated.

Developer technologies | Windows Forms
Developer technologies | Visual Studio | Debugging
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Michael Taylor 60,331 Reputation points
    2022-02-03T19:28:15.75+00:00

    The additional info indicates optimizations so are you building your solution with the Debug configuration? If not then you need to build using debug settings otherwise the debugger won't be able to show you anything useful.

    Also note that this can happen if you are trying to view something that requires code to execute (aka a property) and that code requires that the debugger run other code (hence the thread info in the message).


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.