diff --git a/src/Microsoft.AspNet.Routing/MapRouteRouteBuilderExtensions.cs b/src/Microsoft.AspNet.Routing/MapRouteRouteBuilderExtensions.cs index 21f2c26e70..04e6723f16 100644 --- a/src/Microsoft.AspNet.Routing/MapRouteRouteBuilderExtensions.cs +++ b/src/Microsoft.AspNet.Routing/MapRouteRouteBuilderExtensions.cs @@ -108,8 +108,8 @@ namespace Microsoft.AspNet.Builder } var inlineConstraintResolver = routeBuilder - .ServiceProvider - .GetRequiredService(); + .ServiceProvider + .GetRequiredService(); routeBuilder.Routes.Add(new Route( routeBuilder.DefaultHandler, diff --git a/src/Microsoft.AspNet.Routing/ServiceCollectionExtensions.cs b/src/Microsoft.AspNet.Routing/ServiceCollectionExtensions.cs index 0b9420e428..aba0ecd87b 100644 --- a/src/Microsoft.AspNet.Routing/ServiceCollectionExtensions.cs +++ b/src/Microsoft.AspNet.Routing/ServiceCollectionExtensions.cs @@ -2,7 +2,9 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using System.Text.Encodings.Web; using Microsoft.AspNet.Routing; +using Microsoft.Extensions.DependencyInjection.Extensions; namespace Microsoft.Extensions.DependencyInjection { @@ -25,6 +27,7 @@ namespace Microsoft.Extensions.DependencyInjection throw new ArgumentNullException(nameof(setupAction)); } + services.TryAddSingleton(UrlEncoder.Default); services.Configure(setupAction); } }