Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to view values of variables while debugging

Tags:

c#

.net

asp.net

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 evaluate expression because a thread is stopped at a point where garbage collection is impossible, possibly because the code is optimized.

This is just a regular ASP.NET project. In some portions of the application I can view the properties and variables perfectly fine. I haven't figured out what's different about the blocks of code that I can and can not see the values of the variables in.

like image 304
Rex Morgan Avatar asked Mar 09 '09 04:03

Rex Morgan


2 Answers

The problem was documented on an MSDN blog, as being a size limitation of certain types in certain situations, more details in the link. I believe it was 256 bytes and/or the total size/count of the number of arguments passed to a function. Sorry to say there does not seem to be a quick fix, but hopefully the MSDN blog entry will help you identify a way to solve your problem.

like image 189
CertifiedCrazy Avatar answered Oct 13 '22 01:10

CertifiedCrazy


This article, Rules of Funceval gives a number of reasons why this can occur. If debugging is turned on and optimisation turned off already, there doesn't seem to be much else you can do about this problem.

like image 24
kristianp Avatar answered Oct 13 '22 01:10

kristianp