diff --git a/src/Microsoft.AspNetCore.Dispatcher.Abstractions/Endpoint.cs b/src/Microsoft.AspNetCore.Dispatcher.Abstractions/Endpoint.cs
index a621c76ee3..ed3d96df58 100644
--- a/src/Microsoft.AspNetCore.Dispatcher.Abstractions/Endpoint.cs
+++ b/src/Microsoft.AspNetCore.Dispatcher.Abstractions/Endpoint.cs
@@ -6,7 +6,7 @@ using System.Diagnostics;
namespace Microsoft.AspNetCore.Dispatcher
{
- [DebuggerDisplay("{DisplayName,nq}")]
+ [DebuggerDisplay("{GetType().Name} - '{DisplayName,nq}'")]
public abstract class Endpoint
{
public abstract string DisplayName { get; }
diff --git a/src/Microsoft.AspNetCore.Dispatcher/AmbiguousEndpointException.cs b/src/Microsoft.AspNetCore.Dispatcher/AmbiguousEndpointException.cs
new file mode 100644
index 0000000000..4f54f46cb4
--- /dev/null
+++ b/src/Microsoft.AspNetCore.Dispatcher/AmbiguousEndpointException.cs
@@ -0,0 +1,25 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Runtime.Serialization;
+
+namespace Microsoft.AspNetCore.Dispatcher
+{
+ ///
+ /// An exception which indicates multiple matches in endpoint selection.
+ ///
+ [Serializable]
+ public class AmbiguousEndpointException : Exception
+ {
+ public AmbiguousEndpointException(string message)
+ : base(message)
+ {
+ }
+
+ protected AmbiguousEndpointException(SerializationInfo info, StreamingContext context)
+ : base(info, context)
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Microsoft.AspNetCore.Dispatcher/DispatcherBase.cs b/src/Microsoft.AspNetCore.Dispatcher/DispatcherBase.cs
index 5d3ecb2343..87617e04fe 100644
--- a/src/Microsoft.AspNetCore.Dispatcher/DispatcherBase.cs
+++ b/src/Microsoft.AspNetCore.Dispatcher/DispatcherBase.cs
@@ -4,9 +4,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
+using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
+using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.FileProviders;
+using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Primitives;
namespace Microsoft.AspNetCore.Dispatcher
@@ -17,6 +20,21 @@ namespace Microsoft.AspNetCore.Dispatcher
private List _endpoints;
private List _endpointSelectors;
+ private object _initialize;
+ private bool _selectorsInitialized;
+ private readonly Func