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.
Consider this F# snippet.
------ bug.fsx begins -------
let _ =
match Uri.TryCreate("/foo/bar.js", UriKind.RelativeOrAbsolute) with
| true, v -> printfn "as string=%A, IsAbsoluteUri=%b" v v.IsAbsoluteUri
| _ -> printfn "returned false"
------- bug.fsx ends -------
On mono 3.2.8 it returns
as string=file:///foo/bar.js, IsAbsoluteUri=true
But under .NET the same script returns
as string=/foo/bar.js, IsAbsoluteUri=false
Also, if the 1st param to Uri.TryCreate is "http:" then the result will be different in .NET (return val is true) and mono (return val is false), regardless of UriKind.
This came up while I was testing various corner cases.
Another interesting find today:
produces //www.aaa.com/z.png on .NET and
/www.aaa.com/z.png on mono.
I was careful not to pass strings via the cmd line which could subject them to interpretation by the CMD/powershell prompt or unix shell.
The return values match but the ToString() representation is significantly different.
There is a doc explaining why the UriKind.RelativeOrAbsolute cannot be fixed along with a workaround.
The second problem you mentioned looks too much of an edge case to be fixed. But if it causes you any problem on a real case, let me know and I will fix it.
The third problem cannot be fixed for the same reason as the first one, Mono assumes the given input is an absolute path and ignores repeated file separators.