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.
Created attachment 11395 [details]
Our customer is facing an issue when using HttpClient in a PCL.
This issue is restricted to Android.
We are using System.Net<http://System.Net>.Http in a PCL in order to query a server for some data. In Debug mode everything works fine. In Release mode, we get exceptions, either NameResolutionFailure (if using a Url with named host), or ConnectFailure (if using a Url with explicit IP Address host).
I followed the recommendations regarding using HttpClient and PCL by James Montemagno (http://motzcod.es/post/78863496592/portable-class-libraries-httpclient-so-happy) and that was unsuccessful.
Then I suspected this to be a Linking issue, and therefore tried including System.Net<http://System.Net>.Http in the Ignore assemblies box of the Linker tab in Release mode. This did not solve the problem either.
Finally, I attempted to mimic the configuration from Debug in Release, and narrowed down the issue to having the Enable Developer Instrumentation on. In Release mode, as long as I have this value checked, regardless of the Linking behaviour value, the issue disappears.
I am not certain what this feature is doing under the hood, so I would like to ask for some clarification and guidance as to how to solve my problem (since this flag is not recommended to be set for Release mode).
Version 5.9.1 (build 3)
Installation UUID: 8fd6d227-391c-4e76-8299-8cf8d8a5022c
Mono 4.0.0 ((detached/d136b79)
GTK+ 2.24.23 (Raleigh theme)
Package version: 400000143
Version: 18.104.22.168 (Business Edition)
Android SDK: /Users/ntayefeh/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
4.2 (API level 17)
4.3 (API level 18)
4.4 (API level 19)
4.4.87 (API level 20)
5.0 (API level 21)
Java SDK: /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
Xamarin Android Player
Version: Unknown version
Location: /Applications/Xamarin Android Player.app
Apple Developer Tools
Xcode 6.3.1 (7703)
Version: 22.214.171.1243 (Business Edition)
Build date: 2015-05-20 21:47:57-0400
Release ID: 509010003
Git revision: aad75a6e7e48f18120ce41f47d0ff2c6216f49c3
Build date: 2015-05-08 12:46:18-04
Xamarin addins: 1246b3044cbb7f56a217334f8fc5489ef8eefe3f
Mac OS X 10.10.3
Your app is missing the android.permission.INTERNET permission:
Ran into this issue. That silent failure was not fun.