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 am finding this strange.
HttpUtility.UrlEncode throws error when I run project after selecting "INCLUDE MONO RUNTIME IN APPLICATION BUNDLE" through project options > Max OS X Packaging. I have attached project, and code is written in awakeFromNib. Can you check and confirm and suggest me resolution for this?
My Xamarin studio details are as under
=== Xamarin Studio ===
Version 4.2.3 (build 59)
Installation UUID: fdf8d74f-4fcb-4e5d-95fe-2a01818f1443
Mono 3.2.6 ((no/9b58377)
GTK+ 2.24.23 theme: Raleigh
Package version: 302060000
=== Apple Developer Tools ===
Xcode 5.0.2 (3335.32)
=== Xamarin.iOS ===
=== Xamarin.Android ===
=== Xamarin.Mac ===
=== Build Information ===
Release ID: 402030059
Git revision: 828c2a91b515daaac7e57bc69fcfda6178d4ec01
Build date: 2014-02-18 18:05:23+0000
Xamarin addins: 3bdcc713bdc4b0c04973f3a31b6d47ad3e205962
=== Operating System ===
Mac OS X 10.9.1
Darwin BL-55.local 13.0.0 Darwin Kernel Version 13.0.0
Thu Sep 19 22:22:27 PDT 2013
Created attachment 6151 [details]
full project solution added
This is happening because the linker is removing the default constructor on System.Web.Configuration.WebConfigurationHost, which is an internal implementation detail. System.Configuration in general is not supported. We may fix this in a future release.
As an immediate fix you should try escaping your string with System.Uri.EscapeDataString or System.Uri.EscapeUriString (see  for a good explanation on which one to use given your scenario). These methods are preferred anyway as they do not require a reference to the large System.Web assembly.
Exception for future reference:
System.MissingMethodException: Default constructor not found for type System.Web.Configuration.WebConfigurationHost
at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x00000] in <filename unknown>:0
at System.Activator.CreateInstance (System.Type type) [0x00000] in <filename unknown>:0
at System.Configuration.InternalConfigurationSystem.Init (System.Type typeConfigHost, System.Object hostInitParams) [0x00000] in <filename unknown>:0
at System.Configuration.InternalConfigurationFactory.Create (System.Type typeConfigHost, System.Object hostInitConfigurationParams) [0x00000] in <filename unknown>:0
at System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration (System.String path, System.String site, System.String locationSubPath, System.String server, System.String userName, System.String password, Boolean fweb) [0x00000] in <filename unknown>:0
We looked into this and use of the linker with assemblies that use system.configration (or System.Web.Configuration in this case) is problematic, with many cases running into problems as you've seen. For our new Unified profile, we've restricting use of the linker only to the mobile profile which does not contain system.web.configuration. We're not planning on changing the classic behavior as of right now.
If you run into other problems like this, either disable the linker on classic or move to Unified mobile.