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.
From priority case:
One of our customers noted that their application sometimes crashes when there are multiple tasks created (about 25).
The following error occurs:
Unhandled managed exception: Unable to cast object of type 'MonoTouch.Foundation.NSUrlSessionTask' (Objective-C type: '__NSCFBackgroundDownloadTask') to type 'MonoTouch.Foundation.NSUrlSessionDownloadTask'.
Method: BackgroundServicePoc.Implementation.Synchronization.WebApiDownloadDelegate:DidFinishDownloading (MonoTouch.Foundation.NSUrlSession,MonoTouch.Foundation.NSUrlSessionDownloadTask,MonoTouch.Foundation.NSUrl)
---To reproduce the error---
1. Run the sample app
2. Click the button
3. Sometimes the app will start the downloading tasks and run normally, other times it will hang. You can see the progress of the app in the application output window. When it hangs, if you press the "continue execution button" the above noted exception is thrown.
(Note: Even though it doesn't occur 100% of the time, in my tests it still occurs *very* frequently, requiring only a couple attempts, (less than 5, usually 1 or 2) to reliably reproduce the crash.)
=== Xamarin Studio ===
Version 5.5 (build 198)
Installation UUID: 8ef63a7c-1b18-40de-a334-7f78777fcb55
Mono 3.10.0 ((detached/ac51002)
GTK+ 2.24.23 (Raleigh theme)
Package version: 310000016
=== Apple Developer Tools ===
Xcode 6.0.1 (6528)
=== Xamarin.iOS ===
Version: 184.108.40.206 (Business Edition)
Build date: 2014-09-17 17:40:20-0400
=== Xamarin.Android ===
Version: 220.127.116.11 (Business Edition)
Android SDK: /Users/kentgreen/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
2.1 (API level 7)
2.2 (API level 8)
2.3 (API level 10)
3.1 (API level 12)
4.0 (API level 14)
4.0.3 (API level 15)
4.1 (API level 16)
4.2 (API level 17)
4.3 (API level 18)
4.4 (API level 19)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)
=== Xamarin.Mac ===
Version: 18.104.22.168 (Business Edition)
=== Build Information ===
Release ID: 505000198
Git revision: 7495942eb76d6b80c460ddd61f2b94cba1a97fa2
Build date: 2014-09-18 09:50:12-04
Xamarin addins: c571b625445d60f2c8b189b309a6ffc87386caed
=== Operating System ===
Mac OS X 10.9.4
Darwin Kents-MacBook-Pro.local 13.3.0 Darwin Kernel Version 13.3.0
Tue Jun 3 21:27:35 PDT 2014
Since the sample is from a customer's case, I will reattach it momentarily as a private attachment.
One additional tip for step 1:
1. Run the sample app *in the Debug configuration, with the Xamarin Studio or Visual Studio debugger attached*.
I found it easier to reproduce the problem when I had the debugger attached.
Running it on an iPad simulator (iOS 7 or iOS 8) works fine to reproduce the problem, but I was also able to reproduce on a physical iPhone (iOS 7.1.2) after modifying the storyboard to make the button visible on the smaller screen.
Backported to 8.2