Robert Jordan wrote
> 
> You may get around this by adding another level of indirection:
> 
>       public static int getVersion() {
>         return getVersionInternal();
>       }
> 
>       static int getVersionInternal() {
>         return get_version();
>       }
> 
> This way, the methods containing the p/invoke calls will
> be compiled after the .cctor has been executed.
> 

This works indeed. Too bad it's not consistent with how this would work in
Java. I guess there are no plans on making this consistent, right? 

Anyway, my code is just a workaround until you guys implement #5797
(https://bugzilla.xamarin.com/show_bug.cgi?id=5797). So, a "fix" for the
"Load()" problem here is not that important.

--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/P-Invoke-fails-with-JavaSystem-Load-in-static-constructor-bug-tp5710852p5710938.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

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

Reply via email to