I had tracked third party assemblies but not got any clue.This is the error=> Compiling to native code
/Developer/MonoTouch/usr/bin/mtouch -sdkroot "/Applications/Xcode.app/Contents/Developer" -v --cache "/Users/volgainfotech/Projects/ScrapBoom/Kiln/Scrapboom-Mongo-Stable/ScrapboomPhone/Scrapboom.iPhone/obj/Debug/mtouch-cache" --nomanifest --nosign -dev "/Users/volgainfotech/Projects/ScrapBoom/Kiln/Scrapboom-Mongo-Stable/ScrapboomPhone/Scrapboom.iPhone/bin/iPhone/Debug/ScrapboomiPhone.app" -r "/Users/volgainfotech/Projects/ScrapBoom/Kiln/Scrapboom-Mongo-Stable/ScrapboomPhone/Scrapboom.Core/bin/iPhone/Debug/ScrapboomCore.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Xml.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/MonoTouch.Dialog-1.dll" -r "/Users/volgainfotech/Projects/ScrapBoom/Kiln/Scrapboom-Mongo-Stable/ScrapboomPhone/Assets/Emgu.CV.MonoTouch.dll" -r "/Users/volgainfotech/Projects/ScrapBoom/Kiln/Scrapboom-Mongo-Stable/ScrapboomPhone/Assets/Emgu.Util.MonoTouch.dll" -r "/Users/volgainfotech/Projects/ScrapBoom/Kiln/Scrapboom-Mongo-Stable/ScrapboomPhone/Assets/FlurryAnalytics.dll" -debug -profiling -linksdkonly -sdk "6.1" -targetver "3.1" --sgen --abi=armv7 "--linkskip=system.web" "/Users/volgainfotech/Projects/ScrapBoom/Kiln/Scrapboom-Mongo-Stable/ScrapboomPhone/Scrapboom.iPhone/bin/iPhone/Debug/ScrapboomiPhone.exe" MonoTouch Business version 6.4.1 using framework: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk Linking SDK only for assembly /Users/volgainfotech/Projects/ScrapBoom/Kiln/Scrapboom-Mongo-Stable/ScrapboomPhone/Scrapboom.iPhone/bin/iPhone/Debug/ScrapboomiPhone.exe into /Users/volgainfotech/Projects/ScrapBoom/Kiln/Scrapboom-Mongo-Stable/ScrapboomPhone/Scrapboom.iPhone/obj/Debug/mtouch-cache/PreBuild error MT2002: Failed to resolve assembly: 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
That error can only occur at build time, not when running an application.
It means that one of your dependencies (e.g. a 3rd party binary assembly) has a reference to
System.Web.dll
. That assembly is not shipped with (any version of) Xamarin.iOS.The error does not occur on the simulator because:
it's, by default, not using the linker (which resolves everything);
it's using the Just-In-Time (JIT) compiler so it will hit a missing assembly (or member) only when it try execute the code that requires it;
the Ahead-Of-Time (AOT) compiler, required for running on devices, needs to pre-compile everything, i.e. anything missing will be detected at build time (not runtime)