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.
I get this error with trying to deploy with Link SDK Assemblies only
Error MT2002: Failed to resolve "System.Int32 System.Runtime.InteropServices.Marshal::GetHRForException(System.Exception)" reference from "mscorlib, Version=184.108.40.206, Culture=neutral, PublicKeyToken=7cec85d7bea7798e" (MT2002) (VisualKiosk)
If I select don't link apple rejects the application
We found the following non-public API/s in your app:
The MT2002 error occurs because this `GetHRForException` symbol does not exists in the mscorlib.dll assembly being processed by the linker. Some code from your application (or 3rd party assemblies) is using this (missing) API and needs to be removed/recompiled.
This can be compiled because the current compiler `smcs` needs some extra methods (e.g. System.Reflection.Emit) inside mscorlib.dll - but this is not the one being used on the device (where some features are not allowed). This should be fixed in a future release since we're switching to a newer compiler that does not have this requirement.
Note that this can also "work" on the simulator since the JIT is used. The JIT will only throw an exception if that code is reached at runtime, otherwise the missing symbol won't be "seen".
However the linker (and the AOT compiler) do not like missing symbols and will complain (error or a warning) since all the code is pre-processed/compiled.
>If I select don't link apple rejects the application
From time to time Apple updates their blacklist of selectors. There was a recent update and those symbols were removed from monotouch.dll.
Still you should not disable the linker since you risk to run into other issues (including going over the new Apple limit on executable sizes).
The right solution is to find the code that refer to the missing symbol and remove/replace it.
I assume the issue was fixed. If you still need help with this particular issue than please re-open it along with a test case.