Bug 43649 - Uri.TryCreate doesn't support valid IPV6 uris
Summary: Uri.TryCreate doesn't support valid IPV6 uris
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib ()
Version: 4.4.2 (C7SR1)
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Marek Safar
Depends on:
Reported: 2016-08-23 06:47 UTC by Aaron Stannard
Modified: 2016-08-23 09:52 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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.

Related Links:

Description Aaron Stannard 2016-08-23 06:47:14 UTC
The `Uri.TryCreate` implementation in Mono currently doesn't support parsing valid IPV6 Uris according to the RFC.

Here's a reproduction scenario that will fail:

using NUnit.Framework;
using System;

namespace ParseIPv6
	[TestFixture ()]
	public class Test
		[Test ()]
		public void TestCase ()
			Uri myUri;
			var canParseIPv6 = Uri.TryCreate ("akka.tcp://[::1]:45/user/foo", UriKind.Absolute, out myUri);
			Assert.True (canParseIPv6);


Interestingly, if I change the uri to "http://[::1]:45/user/foo" the spec will pass.

If I rewrite the URI to use an IPv4 address instead, this spec will also pass. "akka.tcp://" passes.
Comment 1 Marek Safar 2016-08-23 09:52:00 UTC
Already fixed in Mono 4.6