Bug 35498 - Could not AOT the assembly 'Microsoft.SharePoint.Client.Runtime.dll'
Summary: Could not AOT the assembly 'Microsoft.SharePoint.Client.Runtime.dll'
Status: RESOLVED ANSWERED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: XI 9.1 (iOS 9.1)
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL: https://bugzilla.xamarin.com/show_bug...
Depends on:
Blocks:
 
Reported: 2015-11-03 10:40 UTC by hansa
Modified: 2015-11-03 13:45 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description hansa 2015-11-03 10:40:02 UTC
I building an app with Xamarin.IOS using Microsoft.SharePoint.Client.Runtime.dll, from Visual Studio 2013 the app builds and deploys fine on iPhone- Simulator but doesn't build nor deploy to Device.

I get the following Error ::

The error log:

Could not AOT the assembly '/Users/zhangx/Library/Caches/Xamarin/mtbs/builds/AppToDelete/028eeb036af52f1bf222d89680bfb8cf/obj/iPhone/Release/mtouch-cache/64/Build/Microsoft.SharePoint.Client.Runtime.dll'

when changing the Linkbehaviour to "Link SDk assemblies only" or "Link all assemblies" then i get another set of errors :

The error log:
Failed to resolve assembly: 'System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
Comment 1 Sebastien Pouliot 2015-11-03 11:52:15 UTC
This happens because the library was not build against either:

* the mobile profile that is shipped with Xamarin.iOS; or

* a PCL profile that is supported by Xamarin.iOS

This makes it impossible to AOT (of even link) the assemblies as it references to code/assemblies that are not available. IOW code generation (or re-writing the assembly) fails.

This can somewhat work using the simulator because it uses the JIT and, as long as the missing code is not reached, the "Just In Time" compilation error will not occur.

OTOH an "Ahead Of TIme" compilation will hit all those "missing" errors as everything needs to be compiled before being delivered to the devices.

You should try to contact the assembly provider and ask if an Xamarin or PCL version of that assembly exists.
Comment 2 hansa 2015-11-03 12:53:02 UTC
Thank you Sebastien for your reply.

contacting the Provider seems to be taking quite sometime, if such versions of assemblies exists would you kindly point them out to me.

as a work around for this problem, I used WCF service to hold the Microsoft.SharePoint.Client.Runtime.dll, by adding a reference of the WCF service into the Xamarin Project, the app does build/deploy to the Device but then gives all these errors related to System.Net.

as in Error log :

System.Net.WebException: Error: ConnectFailure (Connection timed out)
Comment 3 Sebastien Pouliot 2015-11-03 13:45:09 UTC
Sorry I've never used this assembly myself so I do not know if a PCL (or Xamarin) version currently exists. The error itself, while not common, is something we have seen in the past (e.g. System.Configuration is not part of Xamarin's mobile profile).