Take the 2-minute tour ×

I'm using the Uri.TryCreate Method (String, UriKind, Uri) to validate Uris. But it changed my Uri. E.g.:

The method removed a dot after the en_US in the last line of the link. Can you tell me why it changes a correct URI? Or can you tell me another way using the Uri-Class to check if an Uri is correct? (I know there are some

share|improve this question
Am I missing something? Your original and manipulated urls are the same. –  chue x Jan 28 '13 at 17:51
add comment

1 Answer

up vote 1 down vote accepted

For validating Uri you should be using Uri.IsWellFormedUriString instead of Uri.TryCreate method.

Reference: http://msdn.microsoft.com/en-us/library/system.uri.iswellformeduristring.aspx

share|improve this answer
add comment

Your Answer


