TypeLoadException revisited

TypeLoadException revisited

Old forum URL: forums.lhotka.net/forums/t/3611.aspx


bgilbert posted on Friday, September 28, 2007

(Using 2.1.4 in a Winforms app)

I've seen the threads from last year regarding this exception, but never found a solution. To recap, when I instantiate an instance of a BLB object and hover over the variable, I get:

myObject = Count = Exception of type: '{System.TypeLoadException}' occurred.

This was discussed in these threads:
http://forums.lhotka.net/forums/thread/4003.aspx
http://forums.lhotka.net/forums/thread/9993.aspx

The exception hadn't seemed to cause any problems until recently. When I set a bindingsource's datasource to this object, it raises an AgumentOutOfRangeException:
"InvalidArgument=Value of '0' is not valid for 'SelectedIndex'.
Parameter name: SelectedIndex"
I think this is because it cannot read the count property.

Again, I don't think this exception has been a problem, but now I'm having other strange problems that seem related to this. Rather than chase my tail, I thought I'd see if anyone has found a solution to this TypeLoadException. Is it CSLA, .Net? Is this fixed in CSLA 3.0?

RockfordLhotka replied on Friday, September 28, 2007

To my knowledge that exception is a Visual Studio artifact and has nothing to do with how code works at runtime. So I don't think this issue is related to issues with selected index or count values at runtime.

Copyright (c) Marimer LLC