DerrickBrayanClayton / protobuf-net

Automatically exported from code.google.com/p/protobuf-net
0 stars 0 forks source link

MethodAccessException reported from CF 2.0 #30

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Run the QuickStart project under CF 2.0 (tweaking the async TcpListener to 
sync); the List<T>.Sort method reports MethodAccessException when looking 
at Contact/Customer.

Original issue reported on code.google.com by marc.gravell on 20 Nov 2008 at 7:34

GoogleCodeExporter commented 8 years ago
This turns out to be a curiosity of the CF 2.0 security model when using 
generics 
with internal classes from other assemblies (i.e. where the T is private to the 
generic code). Even if no nasty access is attempted, the code (especially 
List<T>.Sort) can break horribly.

Fix: mark your data classes as public, not internal.

Original comment by marc.gravell on 20 Nov 2008 at 7:36

GoogleCodeExporter commented 8 years ago

Original comment by marc.gravell on 20 Nov 2008 at 9:51