Please Explain the Following

Can someone please explain how this is possible?Stumped

posted @ Monday, October 06, 2008 3:36 PM


Print

Comments on this entry:

# re: Please Explain the Following

Left by Germán Schuager at 10/6/2008 11:13 PM
Gravatar

Reflection?

# re: Please Explain the Following

Left by Ayende Rahien at 10/7/2008 12:24 AM
Gravatar

Reflection wouldn't help, the field is marked as readonly.
Can you reproduce this issue? Looks like a CLR bug.

# re: Please Explain the Following

Left by Chris at 10/7/2008 7:59 AM
Gravatar

You can set that[accidentally] to null in the constructor for that class...

# re: Please Explain the Following

Left by Mike at 10/7/2008 8:29 AM

Is this a proxied instance?

# re: Please Explain the Following

Left by Bill Pierce at 10/7/2008 8:56 AM
Gravatar

This particular class has no defined constructors, just relying on the default public constructor.

That breakpoint is hit during deserialization of a WCF call. My only guess is something along the lines of FormatterServices.GetUnintializedObject.

# re: Please Explain the Following

Left by Willie at 10/16/2008 4:23 PM

Seems like the order with maybe something in the CLR or something? Like the object hasn't been instantiated yet, but you're trying to set it. So the set method it looks like is being called before the object is created. Course, no idea how that could really happen, but maybe something with a difference in a List<T> to T[]? Instead of having the instantiation in the class, try setting it directly in the ctor instead? Just guessing :P

Your comment:



 (will not be displayed)


 
 
 
Please add 6 and 4 and type the answer here:
 

Live Comment Preview:

 
«January»
SunMonTueWedThuFriSat
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567