Bug 16574 - error MT3001: Could not AOT the assembly coredx_csharp.dll'
Summary: error MT3001: Could not AOT the assembly coredx_csharp.dll'
Status: RESOLVED INVALID
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 7.0.4.x
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-12-03 16:42 UTC by Allie Miller
Modified: 2013-12-03 19:43 UTC (History)
2 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 INVALID

Description Allie Miller 2013-12-03 16:42:18 UTC
In the attached test project, when building a Xamarin.iOS project, the above error appears with a few other general warnings (please see attached build output log for full details).



Versioning Information:
=== Xamarin Studio ===

Version 4.2.1 (build 1)
Installation UUID: 034c2e78-fc36-4854-bd13-5cba56f0b4b1
Runtime:
Mono 3.2.5 ((no/964e8f0)
GTK+ 2.24.20 theme: Raleigh
GTK# (2.12.0.0)
Package version: 302050000

=== Apple Developer Tools ===

Xcode 5.0.2 (3335.32)
Build 5A3005

=== Xamarin.Android ===

Version: 4.10.1 (Business Edition)
Android SDK: /Users/XXXXXXXXX/Library/Developer/Xamarin/android-sdk-mac_x86
Supported Android versions:
2.1 (API level 7)
2.2 (API level 8)
2.3 (API level 10)
3.1 (API level 12)
4.0 (API level 14)
4.0.3 (API level 15)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

=== Xamarin.iOS ===

Version: 7.0.4.209 (Business Edition)
Hash: 23a0827
Branch:
Build date: 2013-11-11 16:04:00-0500

=== Xamarin.Mac ===

Xamarin.Mac: Not Installed

=== Build Information ===

Release ID: 402010001
Git revision: 844a84fe0aa0cb5f986d4e3c4807a51487d07845
Build date: 2013-11-13 22:12:16+0000
Xamarin addins: 97e44e4863da6c479427794457637e75b3d22600

=== Operating System ===

Mac OS X 10.9.0
Darwin XXXXXX 13.0.2 Darwin Kernel Version 13.0.2
Sun Sep 29 19:38:57 PDT 2013
root:xnu-2422.75.4~1/RELEASE_X86_64 x86_64
Comment 3 Sebastien Pouliot 2013-12-03 19:43:22 UTC
The warning states that the application tries to link to the MS .NET framework, not the SDK assemblies we ship with Xamarin.iOS nor the PCL assemblies.

warning MT3005: The dependency 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' of the assembly 'coredx_csharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' was not found. Please review the project's references.
warning MT3005: The dependency 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' of the assembly 'coredx_csharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' was not found. Please review the project's references.
warning MT3005: The dependency 'System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' of the assembly 'coredx_csharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' was not found. Please review the project's references.

^ those should be referencing version 2.0.5.0

Having the wrong versions means some types were moved (e.g. MS moved the [Extension] attribute from System.Core.dll to mscorlib.dll in 4.0). And this is exactly what the AOT compiler complains about:

Missing method .ctor in assembly /Users/stephen.belcher/Projects/Core DX DDS For iOS Evaluation - Deliverables/hello/hello/obj/iPhone/Debug/mtouch-cache/Build/coredx_csharp.dll, type System.Runtime.CompilerServices.ExtensionAttribute
Can't find custom attr constructor image: /Users/stephen.belcher/Projects/Core DX DDS For iOS Evaluation - Deliverables/hello/hello/obj/iPhone/Debug/mtouch-cache/Build/coredx_csharp.dll mtoken: 0x0a00008d

The solution is to get an updated version of `coredx_csharp.dll` that was built against either PCL assemblies (one of the profile Xamarin supports) or directly against the mobile profile of the framework that we ship.