On Sep 12, 2012, at 1:38 PM, Kirby <d...@adestis.de> wrote:
> What I have real trouble to understand is: Why does the (non linked) version 
> run perfectly on the android device?

Luck. ;-)

You have a JIT, and the JIT won't complain about missing types or members 
unless/until those types/members are actually used. Since your code isn't doing 
anything with the ImmutableObjectAttribute, it doesn't matter (to your code) 
that it's missing.

The linker, on the other hand, visits EVERYTHING, so the linker DOES care if a 
type is missing, and fails because of it.

I suppose we could make it skip types that can't be found, but I'm not sure 
what the actual ramifications would be. Instead of getting "missing type" 
errors at link time, they'd be at runtime...which is already the case when 
Reflection is involved, so this might not change anything. ;-)

> Beside this - what would be the best practice in the above mentioned 
> scenario? Should I build 2 dlls one for mono (2.0.5) and one for .Net 
> (4.0.0.0)?

Yes.

> Strictly spoken I'm not sharing the same contract then anymore...

Close enough?

Keep in mind that this isn't entirely a "new" problem; .NET binary 
serialization had no guarantees that you could e.g. serialize type on .NET 1.1 
and deserialize on 1.0. Things like OptionalFieldAttribute was added in part to 
support this, but if you rename fields, things will break unless you have 
custom serialization.

Which is why we have things like WCF and Protobuff.net, to make such things 
more explicit and tolerant of versioning changes.

The real concern thus isn't over what the client and server provide; it's the 
"version" of the "on-wire" data sent between the client & server, as 
adding/removing fields will change the conceptual version which is being 
transmitted. As long as client & server agree on which version of data is being 
sent (and/or can accommodate a variety of versions), things should work 
regardless of the .NET assembly versions involved.

 - Jon

_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to