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.
This is not bug.. but i need help please..
I am using Monodevelop to develop iPad app. We already have .net 4.0 compiled .dll which i need to use in mono develop project.
I was working with simulator and it was working fine. We just buy mono touch and try to deploy to device, but it's not compiling and give me error
Error MT2001: Could not link assemblies (MT2001)
I search online and i found that i could not use .net compiled .dll directly to mono touch project while deploy to device, we need to compile using mono touch.
I created class library Monodevelop project, add .net compiled .dll release mono touch class library .dll. I checked release folder but it's create all .dll reference. So now i took those files and added to iPad mono touch project and add to reference but still same problem.
I am not sure how i can compile .net precompiled .dll using mono touch.
Please guide me. I am almost ready to deploy to device and this issue stop me to do that.
If it works with the simulator but the linker fails when building for device, that sounds like a linker bug.
To compile a class library for MonoTouch, create a MonoTouch Library project, and add your sources to that (you can add them as "links" instead of copying the files). Then, reference that project from your MonoTouch app.
This is not a linker bug, you'll get a similar error, later, if you disable the linker (on devices).
What happens is that assemblies compiled against .NET 4.0 includes references to types and methods that are not available in the assemblies provided by MonoTouch. You can see them (or at least the first one) if you add "-v -v -v" to the "additional mtouch arguments" in your project options.
That "can" work on the iOS simulator uses the JIT. The Just In Time part means that the missing symbols won't cause issue until the code paths, that uses them, are executed. If they are never executed then you'll never see the (runtime) exceptions.
However for devices we need to AOT (compile ahead of time) the assemblies. That moves the runtime error (for the JIT) to become compile-time error. IOW such assemblies won't work on devices as the missing types/methods will _always_ be found (and be un-compilable).
The fact that it fails at the linker stage is that, like the AOT compiler, the linker process the whole application and finds the missing references before the AOT compiler.
The only solution is the one Michael provided. Re-compile your assembly (from source code) inside a MonoTouch Library project, i.e. against the assemblies shipped with MonoTouch. This is the only way you can be sure they won't reference types/methods that are not available.
note: a future version of MonoTouch (once Mono 2.12 is released) will be based on .NET 4.0 - however the current version is still based on the Silverlight profile (2.1) with some 4.0 additions.
Ok, I will follow those instruction..
Thanks for your comments and time.