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.
A call to System.Threading.AsyncWaitHandle.WaitOne(...) fails on the device with a "linked away" exception. This happens on the physical device (iPad2, iPhone 3G) but in the simulator(s) it works fine.
System.NotSupportedException: Linked away at System.Threading.WaitHandle.WaitOne (Int32 millisecondsTimeout, Boolean exitContext) [0x00000]
Socket socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP);
IAsyncResult ias = socket.BeginConnect(ip, 4201, null, null);
ias.AsyncWaitHandle.WaitOne(15, true)) --> causes exception
Monotouch 4.2.2 / MonoDevelop 2.6
Downgrading severity since there's a workaround available by using "Don't link" in the project's options
note: it should also be possible to use "Link SDK assemblies" and specify "--linkskip=mscorlib" in the "extra mtouch arguments" if a release is required (and/or the app size become a huge nuisance).
would work without issue. However the part where 'exitContext' is true is being linked away.
The above meant that you can resume using "Link SDK assemblies" unless you really need this to be true - but I'm not sure it really works on MonoTouch applications. Where you using 'true' for a specific reason ?
There was no specific reason for using the exitcontext parameter for my purposes, it can be false or ommitted as far as i'm concerned.
Thanks again for the confirmation.
I'll either remove the API or make it clear that that option cannot be used with MonoTouch.
Fixed in 2ce9fc1b0e2afde3101537a27ee367683f1882af (master), mono-2-10 and mobile-master.
MonoTouch will always throw a NotSupportedException when emitContext is set to true (for consistency) for linked, or unlinked, applications.
Thanks for the report / test case!