Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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.
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:
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;
When I build with Link SDK Assemblies only, I get the attached cryptic error. When I build with "Don't Link", all works well.
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.
This case (and several others) are now reported as MTxxxx errors that MD can parse and show properly.