Bug 2323 - mtouch error reporting lacks some details
Summary: mtouch error reporting lacks some details
Alias: None
Product: iOS
Classification: Xamarin
Component: Tools ()
Version: 5.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2011-12-02 18:29 UTC by Brad Pillow
Modified: 2012-05-14 09:22 UTC (History)
2 users (show)

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

Project build error output (3.65 KB, text/rtf)
2011-12-02 18:29 UTC, Brad Pillow

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:

Description Brad Pillow 2011-12-02 18:29:34 UTC
Created attachment 990 [details]
Project build error output

When using F# on my Mac to develop an iPhone app, I receive a somewhat cryptic error (see attached).

I created an FSharp dll (using the FSharp for mac/mono compiler) with this in it:

// ===================

module FSharpTest

type HelloWorld() =
  do System.Console.WriteLine("Hello World");

// in my ios app I reference it in the AppDelegate with this

		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			viewController = new TestViewController ();
			window.RootViewController = viewController;
			window.MakeKeyAndVisible ();
			new FSharpTest.HelloWorld();
			return true;


When I build with Link SDK Assemblies only, I get the attached cryptic error. When I build with "Don't Link", all works well.
Comment 1 Sebastien Pouliot 2011-12-02 20:43:30 UTC
The error messages produced by `mtouch` are being fixed right now. They will be easier to read/parse but they won't be able to tell you much more than they already are. E.g.

Could not link assemblies: Mono.Linker.ResolutionException: Can not resolve reference: System.Reflection.Emit.AssemblyBuilder

This means that the linker cannot find `System.Reflection.Emit.AssemblyBuilder`. That's because System.Reflection.Emit is not supported by MonoTouch and the types not included in (MonoTouch's) mscorlib.dll. This code won't be able to work, without changes, on devices.

Why does it work with "Don't link" ? It works only on the iOS simulator, not on devices

Why ? It's a mix of two things:

1. an artefact of the current compiler (smcs) that requires us to use a full mscorlib.dll when compiling (and use this full version to compile against). This means some extra types are available on the simulator (because the compiler needs them). This "same corlib" requirement will eventually go away when we'll switch to the new `mcs` compiler;

2. the simulator uses the JIT (not the AOT) compiler to get much faster edit/build/debug cycles when developing. This can works because the JIT limitations only exists on the iOS devices (and not on the simulator). It does have some drawbacks (like this one) but the iOS simulator is not an emulator (i.e. it already behave quite differently than the devices in many aspects).

Feel free to attach additional error messages that are not helpful to the bug report. They will be reviewed (and explained when possible) and we'll do our best to ensure the future versions are more helpful.
Comment 2 Sebastien Pouliot 2012-05-14 09:22:56 UTC
This case (and several others) are now reported as MTxxxx errors that MD can parse and show properly.