Unable to view values of variables while debugging

后端 未结 4 1976
星月不相逢
星月不相逢 2021-02-14 00:28

I\'m trying to debug portions of the current application I\'m working on, however when I try and check the value of a property/variable I get the error:

Cannot eva

4条回答
  •  南方客
    南方客 (楼主)
    2021-02-14 01:18

    We have the same problem in two of our WinForm user controls. In both cases the user controls contain a lot of business logic (2000 and 3000 lines of code respectively) and make use of multiple fairly heavy objects (they have 30+ properties that get populated automatically from the database the first time when one of the properties are accessed). When you try to step through the (somewhat complicated) validation and saving methods, you get this same message when trying to access object properties.

    We have come to the conclusion that the size and complexity of the user control combined with the size and complexity of the objects used and conditional database access just becomes too much for the debugger to handle and that we should probably just do some major refactoring to move most of the business logic out of the user control. It would be interesting to know if your problem arises from the same kind of situation and whether doing the said kind of refactoring actually does make a difference (we have not had the time and/or courage :) to do so).

提交回复
热议问题