error MT3001: Could not AOT the assembly when during MonoTouch project compilation - xamarin.ios

I have 2 projects in solution 1. PCL library project (PCL.dll) 2. MonoTouch project
When I'm trying to compile MonoTouch porject I get the following error:
error MT3001: Could not AOT the assembly '../obj/iPhone/Debug/mtouch-cache/Build/PCL.dll'
when I set "link sdk libraries" at MonoTouch project settings I got another error:
MonoTouch Trial version 6.4.0 using framework: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk error MT2002: Failed to resolve "System.Linq.Expressions.ConstantExpression System.Linq.Expressions.Expression::Constant(System.Object)" reference from "System.Linq.Expressions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
I don't use LINQ and have no references to Syste.Linq.Expressions.

Related

Unresolved assembly reference with sandcastle

I am trying to generate documentation with sandcastle help file builder. While building the project in the sandcastle i am getting the following error.
MRefBuilder : error : Unresolved assembly reference: Microsoft.Owin (Microsoft.Owin, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35) required by Microsoft.AspNet.Identity.Owin [C:\Users\inkosah\Documents\Help\Working\GenerateRefInfo.proj]
Last step completed in 00:01:19.4610
Can anybody help me to resolve this issue? I also tried adding it separately to project references in the sandcastle but no help.
Solution 1 : Add missing references to a dummy project.
Create 'dummyProject' (ie class library)
In Visual Studio - Package Manager Console
Install-Package Microsoft.Owin -Version 2.1.0.0 -ProjectName dummyProject
Install-Package Microsoft.Owin.Security.OAuth -version 2.1.0.0 -ProjectName dummyProject
In Sandcastle Help Fil Builder - Project Explore, add two references
Microsoft.aspNet.identity.Owin (dll found in ..\packages\Microsoft.AspNet.Identity.Owin.2.2.0\lib\net45)
Microsoft.Owin (dll found in ..\packages\Microsoft.Owin.2.1.0\lib\net45\Microsoft.Owin.dll)
It looks like MRefBuilder found that Microsoft.AspNet.Identity.Owin relies on Microsoft.Owin (== v 2.1.0) and not Microsoft.Owin (>= 2.1.0).
The main project is still using Microsoft.Owin 3.0.1.0
Solution 2 : Ignore unresolved references
In Documentation (or SHFB) Project Properties / Plug-Ins :
Add "Assembly Binding Redirection" in "Plugs-Ins in This Project"
configure it to "ignore if Unresolved" "Microsoft.Owin" and "Microsoft.Owin.Security.OAuth"

issues after updating to Xamarin Studio

Could not register the assembly
Error messages that I am getting:
'MonoTouch.Dialog-1': MonoTouch.MonoTouchException: Cannot register two managed types('MonoTouch.Dialog.BaseBooleanImageElement+TextWithImageCellView, MonoTouch.Dialog-1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'
and
'MonoTouch.Dialog.BaseBooleanImageElement+TextWithImageCellView, xxxxx1, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null') with the same native name('MonoTouch_Dialog_BaseBooleanImageElement_TextWithImageCellView').
tried with mtouch arguments --registrar:legacy, not able fix the issue.
You've included both MonoTouch.Dialog-1.dll and MonoTouch.Dialog.dll in your app. Choose one.

Monotouch - Failed to resolve ExtensionAttribute

Using Xcode 5.0.1 with Xamarin studio Version 4.0.13 (build 38) and Xamarin.iOS
Version: 6.2.4.2
I am getting this error when trying to compile my project:
error MT2002: Failed to resolve "System.Void System.Runtime.CompilerServices.ExtensionAttribute::.ctor()" reference from "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
How can I solve it?
The reason for this error is that between .NET 2.0 (including Silverlight) and 4.0 the [Extension] attribute moved from System.Core.dll to mscorlib.dll.
Xamarin.iOS 6.2 (and earlier) were based on a superset of Silverlight (aka the 2.1 profile). So the [Extension] attribute was located in System.Core.dll.
Since Xamarin.iOS 6.3+ the product was re-based on Mono 3.0 and the profile was updated to use the newer 4.0/4.5 profile. Now the [Extension] attribute is located in mscorlib.dll.
In your case you had a binary assembly compiled against the newer (4.0) profile. That assembly had a reference to mscorlib, Version=4.0.0.0, ... to find [Extension] and would lead to errors if built against the older Xamarin.iOS (6.2 and earlier).
As you found out the easy solution was to update to the latest Xamarin.iOS release. Another way to solve this (without updating Xamarin.iOS) would have been to rebuild (if you have the source) the binary assemblies of your project against the assemblies (BCL) shipped with Xamarin.iOS 6.2.

The dependency ''mscorlib, Version=2.0.0.0,...' was not found

i get the following error by compiling my project:
warning MT3005: The dependency 'mscorlib, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' of the assembly
'ICSharpCode.SharpZipLib, Version=0.86.0.518, 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
'ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral,
PublicKeyToken=null' was not found. Please review the project's
references.
warning MT3006: Could not compute a complete dependency map for the
project. This will result in slower build times because Xamarin.iOS
can't properly detect what needs to be rebuilt (and what does not need
to be rebuilt). Please review previous warnings for more details.
I've found out that the System dependency of my project uses the version 2.0.5.0 and the ZipSharp uses 2.0.0.0
What should I do?
To fix the warnings you need to get (or build from sources) a version of ZipSharp that is compiled against the BCL (mscorlib.dll, System.dll) that is shipped with Xamarin.iOS (i.e. 2.0.5.0).
Note that those are warnings, not errors, so it might work.

Linking External dll

I am working with Visual Studio 2012. I am externally "Microsoft.Phone.Controls.Toolkit.dll". The project compiles and works fine when I run in debug mode. However gives me the following error message when I try to compile for release:
Warning 1 Could not resolve this reference. Could not locate the assembly "Microsoft.Phone.Controls.Toolkit, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b772ad94eb9ca604, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. WindowsPhoneNavigationTransitions
How do i solve this issue?

Resources