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
GitHub or Developer Community 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 I try to access Headers.Host (https://github.com/mono/mono/blob/master/mcs/class/System.Net.Http/System.Net.Http.Headers/HttpRequestHeaders.cs#L163) I get an invalid cast exception :
System.InvalidCastException : Cannot cast from source type to destination type.
at (wrapper castclass) object:__castclass_with_cache (object,intptr,intptr)
at System.Net.Http.Headers.HttpHeaders.GetValue[String] (System.String name) [0x00000] in <filename unknown>:0
at System.Net.Http.Headers.HttpRequestHeaders.get_Host () [0x00000] in <filename unknown>:0
MonoMac is for the open source binding to build Mac GUI applications. This appears to be a class library bug.
Please consider filing similar bugs against that product in the future. I will move this one over.
How can I reproduce the issue?
I had this issue as well on Linux with Mono 4.0.4.
I did some searching, and this is what I found.
Workaround (this worked for me as well):
Please test with Mono 4.2 it has a fix included for quire similar issue
Closing, please reopen if you can still reproduce it with Mono 4.4