Richard Liebmann
Richard Liebmann

Reputation: 455

Monotouch/WCF Error on iPhone Hardware

I created a WCF Client on Monotouch with the Silverlight SLSvcUtil.exe Tool similar to http://docs.xamarin.com/ios/tutorials/Working_with_Web_Services#Consuming_WCF_Services.

On the Simulator everything works fine but when i started it on an iPhone 4S i got the error :

Attempting to JIT compile method '(wrapper delegate-begin-invoke) :begin_invoke_IAsyncResult_this__TimeSpan_AsyncCallback_object (System.TimeSpan,System.AsyncCallback,object)' while running with --aot-only.

Any ideas?

Upvotes: 1

Views: 202

Answers (2)

poupou
poupou

Reputation: 43553

Such issues are rarely linker related, even less if the signature is a wrapper. However you can confirm this easily with Stuart's instructions.

IMO you are likely hitting a case where the AOT compiler could not predict the required code. That can happens when mixing generics and value-types (and you have a TimeSpan in generated signature). This will work on the simulator (where the JIT is used) but not when AOT'ing the application.

The best way to solve such issue is to open a bug report at http://bugzilla.xamarin.com and attach a test case that allow us to replicate the issue.

Upvotes: 0

Stuart
Stuart

Reputation: 66882

I've called a few wcf services from monotouch without hitting any issues like this- so it can be done.

The jit error within monotouch normally indicates either that something has been removed by the linker, or that some virtual abstract method has been called (at least in my recent experience).

Can you check the linker settings for your real iPhone project? Does the problem go away if you set it to -nolink - see http://docs.xamarin.com/ios/advanced_topics/linker

If that does help, then the next step is to take a look within the wcf generated file - can you find and post some more code about the callback method in this case?

Upvotes: 1

Related Questions