diff --git a/samples/HostedInAspNet.Client/HostedInAspNet.Client.csproj b/samples/HostedInAspNet.Client/HostedInAspNet.Client.csproj
index 038ec80f9f..fbec52a713 100644
--- a/samples/HostedInAspNet.Client/HostedInAspNet.Client.csproj
+++ b/samples/HostedInAspNet.Client/HostedInAspNet.Client.csproj
@@ -3,9 +3,6 @@
netstandard2.0
Exe
-
-
- false
diff --git a/src/Microsoft.AspNetCore.Blazor.Server/AutoRebuild/AutoRebuildExtensions.cs b/src/Microsoft.AspNetCore.Blazor.Server/AutoRebuild/AutoRebuildExtensions.cs
index a54e023966..471f6e9545 100644
--- a/src/Microsoft.AspNetCore.Blazor.Server/AutoRebuild/AutoRebuildExtensions.cs
+++ b/src/Microsoft.AspNetCore.Blazor.Server/AutoRebuild/AutoRebuildExtensions.cs
@@ -3,7 +3,10 @@
using Microsoft.AspNetCore.Blazor.Server;
using Microsoft.AspNetCore.Blazor.Server.AutoRebuild;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Logging;
using System;
+using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
@@ -19,7 +22,48 @@ namespace Microsoft.AspNetCore.Builder
private static string[] _includedSuffixes = new[] { ".cs", ".cshtml", "index.html" };
private static string[] _excludedDirectories = new[] { "obj", "bin" };
- public static void UseAutoRebuild(this IApplicationBuilder appBuilder, BlazorConfig config)
+ // To ensure the FileSystemWatchers aren't collected, reference them
+ // in this static list. They never need to be removed because there's no
+ // way to remove middleware once it's registered.
+ private static List