In the docs this is used all over the place:

new Uri("somefile.txt")

but that throws an exception "Bad Uri Format". It works if you specify:

new Uri("somefile.txt", UriKind.Relative)

Is this a bug or how it is supposed to work? I thought Uri's were relative
by default (though I have 'reflected' it yet).

Thanks,

Shawn Wildermuth
Microsoft MVP (C#)
http://wildermuthconsulting.com
mailto:swildermuth@REMOVE_ALLCAPS_adoguy.co

Re: Bad Uri Format by Shawn

Shawn
Mon Mar 10 18:57:24 CDT 2008

Wrong, forum sorry!

Thanks,

Shawn Wildermuth
Microsoft MVP (C#)
http://wildermuthconsulting.com
mailto:swildermuth@REMOVE_ALLCAPS_adoguy.com

> In the docs this is used all over the place:
>
> new Uri("somefile.txt")
>
> but that throws an exception "Bad Uri Format". It works if you
> specify:
>
> new Uri("somefile.txt", UriKind.Relative)
>
> Is this a bug or how it is supposed to work? I thought Uri's were
> relative by default (though I have 'reflected' it yet).
>