Unable to debug managed code using visual studio 2013 (“Cannot evaluate expression” error - am using debug build) (Note that VS 2012 works)

后端 未结 9 1765
青春惊慌失措
青春惊慌失措 2020-12-07 20:32

I have .net application (GUI as well as PowerShell) built against 4.5. My OS is server 2012. When I attach my application to 2013 visual studio, the debugger is not working

9条回答
  •  轮回少年
    2020-12-07 20:57

    I had a similar problem debugging where this error occurred from a return from creating a class. The class initialized fine (using "new classname()") but then it gave the "cannot evaluate expression" error on the return. Though it worked on previous visual studio versions, running on VS 2017 it crapped out.

    After a lot of head banging, it turned out that private variables in the class, especially things like arraylists and other classes, needed to be declared with initial values, even if set to null.

    Once that was done, everything worked, even though the solution "appeared" to have nothing to do with the problem and gave no apparent clue of where the problem occurred.

提交回复
热议问题