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.
The read-only stream created for reading HTTP requests returns False for CanSeek. The type I see being used in Mono is System.Net.RequestStream.
This causes numerous problems in ASP.NET Web API, which appears to assume that the request stream supports seek. I also need the ability to seek on this stream in my application.
I'll work on getting more details and creating a test case for this.
It looks like the inner-most stream in an HttpListener in .NET doesn't support seeking, but at some point in the ASP.NET Web API stack the stream gets wrapped in a buffering stream. This is the part that's not working in mono, so it may be specific to ASP.NET Web API.
I'm still trying to track down the calls that Web API is making from which it expects to receive a buffered stream.
I tracked down the root cause to the RequestStream class, which was returning -1 instead of 0 for the number of bytes read in EndRead at the end of the stream. I have fixed this in my fork at https://github.com/strawd/mono/commit/2d420541ed6fb18d436be8b83d5b9c9fae9d3263 and have submitted a pull request to mono master.
Fixed in master with David's patch. master/aa1c098cb9