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.
When canceling a running Task that is doing a network call, an exception is thrown: The object was used after being disposed.
**Steps to Reproduce:**
1. Run the attached sample on an iPhone Simulator
2. Press the only Button multiple times, quickly.
System.ObjectDisposedException: The object was used after being disposed.
at System.Net.WebConnection.EndWrite (System.Net.HttpWebRequest request, Boolean throwOnError, IAsyncResult result) [0x0002c] in //Library/Frameworks/Xamarin.iOS.framework/Versions/220.127.116.11/src/mono/mcs/class/System/System.Net/WebConnection.cs:1071
at System.Net.WebConnectionStream.WriteAsyncCB (IAsyncResult r) [0x00013] in //Library/Frameworks/Xamarin.iOS.framework/Versions/18.104.22.168/src/mono/mcs/class/System/System.Net/WebConnectionStream.cs:458
Full stacktrace here: https://gist.github.com/therealjohn/e8128aef9ea9444e3836
No exceptions and the task is cancelled.
**Build Date & Platform:**
=== Xamarin Studio ===
Version 5.9.4 (build 5)
Installation UUID: e01c3049-a2d2-4e0a-aad8-afe6fb627c4d
Mono 4.0.2 ((detached/c99aa0c)
GTK+ 2.24.23 (Raleigh theme)
Package version: 400020005
=== Xamarin.Android ===
Version: 22.214.171.124 (Business Edition)
Android SDK: /Users/johnmiller/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
2.3 (API level 10)
4.0.3 (API level 15)
4.1 (API level 16)
4.2 (API level 17)
4.4 (API level 19)
5.0 (API level 21)
Java SDK: /usr
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
=== Xamarin Android Player ===
Version: Unknown version
Location: /Applications/Xamarin Android Player.app
=== Apple Developer Tools ===
Xcode 6.3 (7569)
=== Xamarin.iOS ===
Version: 126.96.36.199 (Business Edition)
Build date: 2015-06-30 15:19:13-0400
=== Xamarin.Mac ===
Version: 188.8.131.52 (Business Edition)
=== Build Information ===
Release ID: 509040005
Git revision: 8010a90f6e246b32364e3fb46ef2c9d1be9c9a2b
Build date: 2015-06-08 16:52:06-04
Xamarin addins: 7e93e9c3503f28770f23ce1b7eafd829919f18e8
=== Operating System ===
Mac OS X 10.10.2
I tried to replicate this in a simpler console app (included in the soluton as "ConsoleTest"), but it was not successful so I included the iOS app.
Also stems from this: http://stackoverflow.com/questions/31020937/cancelling-a-task-results-in-objectdisposedexception
*** This bug has been marked as a duplicate of bug 31507 ***