diff --git a/Blazor.sln b/Blazor.sln
index dfffd765ed..dd676cd16c 100644
--- a/Blazor.sln
+++ b/Blazor.sln
@@ -90,8 +90,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.VisualStudio.Blaz
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestContentPackage", "test\testapps\TestContentPackage\TestContentPackage.csproj", "{C57382BC-EE93-49D5-BC40-5C98AF8AA048}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LiveReloadTestApp", "test\testapps\LiveReloadTestApp\LiveReloadTestApp.csproj", "{0246AA77-1A27-4A67-874B-6EF6F99E414E}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmarks", "benchmarks", "{36A7DEB7-5F88-4BFB-B57E-79EEC9950E25}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Blazor.Performance", "benchmarks\Microsoft.AspNetCore.Blazor.Performance\Microsoft.AspNetCore.Blazor.Performance.csproj", "{50F6820F-D058-4E68-9E15-801F893F514E}"
@@ -319,14 +317,6 @@ Global
{C57382BC-EE93-49D5-BC40-5C98AF8AA048}.Release|Any CPU.Build.0 = Release|Any CPU
{C57382BC-EE93-49D5-BC40-5C98AF8AA048}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
{C57382BC-EE93-49D5-BC40-5C98AF8AA048}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU
- {0246AA77-1A27-4A67-874B-6EF6F99E414E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {0246AA77-1A27-4A67-874B-6EF6F99E414E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {0246AA77-1A27-4A67-874B-6EF6F99E414E}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
- {0246AA77-1A27-4A67-874B-6EF6F99E414E}.DebugNoVSIX|Any CPU.Build.0 = Debug|Any CPU
- {0246AA77-1A27-4A67-874B-6EF6F99E414E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {0246AA77-1A27-4A67-874B-6EF6F99E414E}.Release|Any CPU.Build.0 = Release|Any CPU
- {0246AA77-1A27-4A67-874B-6EF6F99E414E}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
- {0246AA77-1A27-4A67-874B-6EF6F99E414E}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU
{50F6820F-D058-4E68-9E15-801F893F514E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{50F6820F-D058-4E68-9E15-801F893F514E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{50F6820F-D058-4E68-9E15-801F893F514E}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
@@ -375,7 +365,6 @@ Global
{43E39257-7DC1-46BD-9BD9-2319A1313D07} = {F563ABB6-85FB-4CFC-B0D2-1D5130E8246D}
{9088E4E4-B855-457F-AE9E-D86709A5E1F4} = {F563ABB6-85FB-4CFC-B0D2-1D5130E8246D}
{C57382BC-EE93-49D5-BC40-5C98AF8AA048} = {4AE0D35B-D97A-44D0-8392-C9240377DCCE}
- {0246AA77-1A27-4A67-874B-6EF6F99E414E} = {4AE0D35B-D97A-44D0-8392-C9240377DCCE}
{50F6820F-D058-4E68-9E15-801F893F514E} = {36A7DEB7-5F88-4BFB-B57E-79EEC9950E25}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
diff --git a/src/Microsoft.AspNetCore.Blazor.Browser.JS/src/Boot.ts b/src/Microsoft.AspNetCore.Blazor.Browser.JS/src/Boot.ts
index 7ddd84ff61..065c711523 100644
--- a/src/Microsoft.AspNetCore.Blazor.Browser.JS/src/Boot.ts
+++ b/src/Microsoft.AspNetCore.Blazor.Browser.JS/src/Boot.ts
@@ -1,6 +1,5 @@
import { platform } from './Environment';
import { getAssemblyNameFromUrl } from './Platform/DotNet';
-import { enableLiveReloading } from './LiveReloading';
import './Rendering/Renderer';
import './Services/Http';
import './Services/UriHelper';
@@ -37,13 +36,6 @@ async function boot() {
// Start up the application
platform.callEntryPoint(entryPointAssemblyName, entryPointMethod, []);
-
- // Enable live reloading only if there's a "reload" attribute on the ";
- var assemblyReferences = new string[] { "System.Abc.dll", "MyApp.ClassLib.dll", };
-
- // Act
- var fileContents = IndexHtmlWriter.GetIndexHtmlContents(
- htmlTemplate,
- "MyApp.Entrypoint",
- "MyNamespace.MyType::MyMethod",
- assemblyReferences,
- /* js references */ new string[] {},
- /* js references */ new string[] {},
- /* linkerEnabled */ true,
- /* reloadUri */ null);
-
- // Assert
- var parsedHtml = new HtmlParser().Parse(fileContents);
- var scriptElem = parsedHtml.QuerySelector("script");
- Assert.False(scriptElem.HasAttribute("reload"));
- }
[Fact]
public void SuppliesHtmlTemplateUnchangedIfNoBootScriptPresent()
@@ -105,7 +79,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
var cssReferences = new string[] { "my/styles.css" };
var content = IndexHtmlWriter.GetIndexHtmlContents(
- htmlTemplate, "MyApp.Entrypoint", "MyNamespace.MyType::MyMethod", assemblyReferences, jsReferences, cssReferences, linkerEnabled: true, reloadUri: "/my/reload");
+ htmlTemplate, "MyApp.Entrypoint", "MyNamespace.MyType::MyMethod", assemblyReferences, jsReferences, cssReferences, linkerEnabled: true);
// Assert
Assert.Equal(htmlTemplate, content);
diff --git a/test/Microsoft.AspNetCore.Blazor.E2ETest/Microsoft.AspNetCore.Blazor.E2ETest.csproj b/test/Microsoft.AspNetCore.Blazor.E2ETest/Microsoft.AspNetCore.Blazor.E2ETest.csproj
index 6c681cedfc..7045e97bc6 100644
--- a/test/Microsoft.AspNetCore.Blazor.E2ETest/Microsoft.AspNetCore.Blazor.E2ETest.csproj
+++ b/test/Microsoft.AspNetCore.Blazor.E2ETest/Microsoft.AspNetCore.Blazor.E2ETest.csproj
@@ -24,7 +24,6 @@
-
diff --git a/test/Microsoft.AspNetCore.Blazor.E2ETest/Tests/LiveReloadingTest.cs b/test/Microsoft.AspNetCore.Blazor.E2ETest/Tests/LiveReloadingTest.cs
deleted file mode 100644
index 925fdfd338..0000000000
--- a/test/Microsoft.AspNetCore.Blazor.E2ETest/Tests/LiveReloadingTest.cs
+++ /dev/null
@@ -1,118 +0,0 @@
-// 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 LiveReloadTestApp;
-using Microsoft.AspNetCore.Blazor.E2ETest.Infrastructure;
-using Microsoft.AspNetCore.Blazor.E2ETest.Infrastructure.ServerFixtures;
-using OpenQA.Selenium;
-using OpenQA.Selenium.Support.UI;
-using System;
-using System.Diagnostics;
-using System.IO;
-using Xunit;
-
-namespace Microsoft.AspNetCore.Blazor.E2ETest.Tests
-{
- // We need an entirely separate test app for the live reloading tests, because
- // otherwise it might break other tests that were running parallel (e.g., if we
- // triggered a reload here while other tests were waiting for something to happen).
-
- public class LiveReloadingTest
- : ServerTestBase>
- {
- private const string ServerPathBase = "/live/reloading/subdir";
- private readonly DevHostServerFixture _serverFixture;
-
- public LiveReloadingTest(BrowserFixture browserFixture, DevHostServerFixture serverFixture)
- : base(browserFixture, serverFixture)
- {
- _serverFixture = serverFixture;
- serverFixture.Environment = "Development"; // Otherwise the server won't accept live reloading connections
- serverFixture.PathBase = ServerPathBase;
- Navigate(ServerPathBase);
- WaitUntilLoaded();
- }
-
- [Fact]
- public void ReloadsWhenWebRootFilesAreModified()
- {
- // Verify we have the expected starting point
- var jsFileOutputSelector = By.Id("some-js-file-output");
- Assert.Equal("initial value", Browser.FindElement(jsFileOutputSelector).Text);
-
- var jsFilePath = Path.Combine(_serverFixture.ContentRoot, "wwwroot", "someJsFile.js");
- var origContents = File.ReadAllText(jsFilePath);
- try
- {
- // Edit the source file on disk
- var newContents = origContents.Replace("'initial value'", "'modified value'");
- File.WriteAllText(jsFilePath, newContents);
-
- // See that the page reloads and reflects the updated source file
- new WebDriverWait(Browser, TimeSpan.FromSeconds(30)).Until(
- driver => driver.FindElement(jsFileOutputSelector).Text == "modified value");
- WaitUntilLoaded();
- }
- finally
- {
- // Restore original state
- File.WriteAllText(jsFilePath, origContents);
- }
- }
-
- [Fact]
- public void ReloadsWhenBlazorAppRebuilds()
- {
- // Verify we have the expected starting point
- var appElementSelector = By.TagName("app");
- Assert.Equal("Hello, world!", Browser.FindElement(appElementSelector).Text);
-
- var cshtmlFilePath = Path.Combine(_serverFixture.ContentRoot, "Home.cshtml");
- var origContents = File.ReadAllText(cshtmlFilePath);
- try
- {
- // Edit the source file on disk
- var newContents = origContents.Replace("Hello", "Goodbye");
- File.WriteAllText(cshtmlFilePath, newContents);
-
- // Trigger build
- var buildConfiguration = DetectBuildConfiguration(_serverFixture.ContentRoot);
- var buildProcess = Process.Start(new ProcessStartInfo
- {
- FileName = "dotnet",
- Arguments = $"build --no-restore --no-dependencies -c {buildConfiguration}",
- WorkingDirectory = _serverFixture.ContentRoot
- });
- Assert.True(buildProcess.WaitForExit(60 * 1000));
- Assert.Equal(0, buildProcess.ExitCode);
-
- // See that the page reloads and reflects the updated source file
- new WebDriverWait(Browser, TimeSpan.FromSeconds(30)).Until(
- driver => driver.FindElement(appElementSelector).Text == "Goodbye, world!");
- }
- finally
- {
- // Restore original state
- File.WriteAllText(cshtmlFilePath, origContents);
- }
- }
-
- private object DetectBuildConfiguration(string contentRoot)
- {
- // We want the test to issue the build with the same configuration that
- // the project was already built with (otherwise there will be errors because
- // of having multiple directories under /bin, plus it means we don't need
- // to restore and rebuild all dependencies so it's faster)
- var binDirInfo = new DirectoryInfo(Path.Combine(contentRoot, "bin"));
- var configurationDirs = binDirInfo.GetDirectories();
- Assert.Single(configurationDirs);
- return configurationDirs[0].Name;
- }
-
- private void WaitUntilLoaded()
- {
- new WebDriverWait(Browser, TimeSpan.FromSeconds(30)).Until(
- driver => driver.FindElement(By.TagName("app")).Text != "Loading...");
- }
- }
-}
diff --git a/test/testapps/LiveReloadTestApp/Home.cshtml b/test/testapps/LiveReloadTestApp/Home.cshtml
deleted file mode 100644
index 9f735a6307..0000000000
--- a/test/testapps/LiveReloadTestApp/Home.cshtml
+++ /dev/null
@@ -1 +0,0 @@
-Hello, world!
diff --git a/test/testapps/LiveReloadTestApp/LiveReloadTestApp.csproj b/test/testapps/LiveReloadTestApp/LiveReloadTestApp.csproj
deleted file mode 100644
index dd97d39d71..0000000000
--- a/test/testapps/LiveReloadTestApp/LiveReloadTestApp.csproj
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-
- netstandard2.0
-
-
- dotnet
- run --project ..\..\..\src\Microsoft.AspNetCore.Blazor.Cli serve --pathbase /live/reloading/subdir
-
-
- true
-
-
-
-
-
-
-
-
-
-
diff --git a/test/testapps/LiveReloadTestApp/Program.cs b/test/testapps/LiveReloadTestApp/Program.cs
deleted file mode 100644
index 0aee7832e8..0000000000
--- a/test/testapps/LiveReloadTestApp/Program.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-// 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 Microsoft.AspNetCore.Blazor.Browser.Rendering;
-
-namespace LiveReloadTestApp
-{
- public class Program
- {
- static void Main(string[] args)
- {
- new BrowserRenderer().AddComponent("app");
- }
- }
-}
diff --git a/test/testapps/LiveReloadTestApp/wwwroot/index.html b/test/testapps/LiveReloadTestApp/wwwroot/index.html
deleted file mode 100644
index 5c7d816ec2..0000000000
--- a/test/testapps/LiveReloadTestApp/wwwroot/index.html
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
- Live reload test app
-
-
-
- Loading...
-
-
-
-
-
-
diff --git a/test/testapps/LiveReloadTestApp/wwwroot/someJsFile.js b/test/testapps/LiveReloadTestApp/wwwroot/someJsFile.js
deleted file mode 100644
index af61769b29..0000000000
--- a/test/testapps/LiveReloadTestApp/wwwroot/someJsFile.js
+++ /dev/null
@@ -1,3 +0,0 @@
-// We modify this on disk during E2E tests to verify it causes a reload
-var valueToWrite = 'initial value';
-document.getElementById('some-js-file-output').textContent = valueToWrite;
diff --git a/tooling/Microsoft.VisualStudio.BlazorExtension/BlazorPackage.cs b/tooling/Microsoft.VisualStudio.BlazorExtension/BlazorPackage.cs
index aecd734a44..1d93fb5164 100644
--- a/tooling/Microsoft.VisualStudio.BlazorExtension/BlazorPackage.cs
+++ b/tooling/Microsoft.VisualStudio.BlazorExtension/BlazorPackage.cs
@@ -4,7 +4,6 @@
using System;
using System.Runtime.InteropServices;
using Microsoft.VisualStudio.Shell;
-using Microsoft.VisualStudio.Shell.Interop;
namespace Microsoft.VisualStudio.BlazorExtension
{
@@ -12,24 +11,8 @@ namespace Microsoft.VisualStudio.BlazorExtension
[PackageRegistration(UseManagedResourcesOnly = true)]
[AboutDialogInfo(PackageGuidString, "ASP.NET Core Blazor Language Services", "#110", "112")]
[Guid(BlazorPackage.PackageGuidString)]
- [ProvideAutoLoad(UIContextGuids80.SolutionExists)]
public sealed class BlazorPackage : Package
{
public const string PackageGuidString = "d9fe04bc-57a7-4107-915e-3a5c2f9e19fb";
-
- protected override void Initialize()
- {
- base.Initialize();
- RegisterLiveReloadBuildWatcher();
- }
-
- private void RegisterLiveReloadBuildWatcher()
- {
- // No need to unadvise, as this only happens once anyway
- ThreadHelper.ThrowIfNotOnUIThread();
- var buildManager = (IVsSolutionBuildManager)GetService(typeof(SVsSolutionBuildManager));
- var hr = buildManager.AdviseUpdateSolutionEvents(new LiveReloadBuildWatcher(), out var cookie);
- Marshal.ThrowExceptionForHR(hr);
- }
}
}
diff --git a/tooling/Microsoft.VisualStudio.BlazorExtension/LiveReloadBuildWatcher.cs b/tooling/Microsoft.VisualStudio.BlazorExtension/LiveReloadBuildWatcher.cs
deleted file mode 100644
index da487b4ed7..0000000000
--- a/tooling/Microsoft.VisualStudio.BlazorExtension/LiveReloadBuildWatcher.cs
+++ /dev/null
@@ -1,119 +0,0 @@
-// 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 Microsoft.VisualStudio.ProjectSystem.Properties;
-using Microsoft.VisualStudio.Shell;
-using Microsoft.VisualStudio.Shell.Interop;
-using System;
-using System.Collections.Generic;
-using System.IO;
-
-namespace Microsoft.VisualStudio.BlazorExtension
-{
- internal class LiveReloadBuildWatcher : IVsUpdateSolutionEvents2
- {
- const string BlazorProjectCapability = "Blazor";
-
- private bool _isListeningForProjectBuilds = false;
- private List _signalFilePathsToNotify = new List();
-
- public int UpdateSolution_Begin(ref int pfCancelUpdate)
- {
- _signalFilePathsToNotify.Clear();
- _isListeningForProjectBuilds = true;
- return VSConstants.S_OK;
- }
-
- public int UpdateSolution_Done(int fSucceeded, int fModified, int fCancelCommand)
- {
- _isListeningForProjectBuilds = false;
-
- foreach (var fullPath in _signalFilePathsToNotify)
- {
- try
- {
- File.WriteAllText(fullPath, string.Empty);
- File.Delete(fullPath);
- }
- catch (Exception ex)
- {
- AttemptLogError($"Blazor live reloading was unable to write to the signal " +
- $"file at {fullPath}. To disable live reloading, set the property " +
- $"'UseBlazorLiveReloading' to 'false' in your project file." +
- $"\nThe exception was: {ex.Message}\n{ex.StackTrace}");
- }
- }
-
- return VSConstants.S_OK;
- }
-
- private void AttemptLogError(string message)
- {
- ThreadHelper.ThrowIfNotOnUIThread();
- var outputWindow = (IVsOutputWindow)Package.GetGlobalService(typeof(SVsOutputWindow));
- if (outputWindow != null)
- {
- outputWindow.GetPane(VSConstants.OutputWindowPaneGuid.BuildOutputPane_guid, out var pane);
- if (pane != null)
- {
- pane.OutputString(message);
- pane.Activate();
- }
- }
- }
-
- public int UpdateSolution_StartUpdate(ref int pfCancelUpdate)
- => VSConstants.S_OK;
-
- public int UpdateSolution_Cancel()
- => VSConstants.S_OK;
-
- public int OnActiveProjectCfgChange(IVsHierarchy pIVsHierarchy)
- => VSConstants.S_OK;
-
- public int UpdateProjectCfg_Begin(IVsHierarchy pHierProj, IVsCfg pCfgProj, IVsCfg pCfgSln, uint dwAction, ref int pfCancel)
- => VSConstants.S_OK;
-
- public int UpdateProjectCfg_Done(IVsHierarchy pHierProj, IVsCfg pCfgProj, IVsCfg pCfgSln, uint dwAction, int fSuccess, int fCancel)
- {
- if (_isListeningForProjectBuilds
- && fSuccess == 1 // i.e., build succeeded
- && pHierProj.IsCapabilityMatch(BlazorProjectCapability))
- {
- var configuredProject = ((IVsBrowseObjectContext)pCfgProj).ConfiguredProject;
- var projectLockService = configuredProject
- .UnconfiguredProject
- .ProjectService
- .Services
- .ProjectLockService;
-
- ThreadHelper.JoinableTaskFactory.Run(async delegate
- {
- using (var access = await projectLockService.ReadLockAsync())
- {
- var project = await access.GetProjectAsync(configuredProject);
-
- // Now we can evaluate MSBuild properties
- var useLiveReloading = project.GetPropertyValue("UseBlazorLiveReloading");
- var projectDir = project.GetPropertyValue("ProjectDir");
- var outputPath = project.GetPropertyValue("OutputPath");
- var signalFilePath = project.GetPropertyValue("BlazorBuildCompletedSignalPath");
- if (string.Equals(useLiveReloading, "true", StringComparison.Ordinal)
- && !string.IsNullOrEmpty(projectDir)
- && !string.IsNullOrEmpty(outputPath)
- && !string.IsNullOrEmpty(signalFilePath))
- {
- var fullPath = Path.Combine(
- projectDir,
- outputPath,
- signalFilePath);
- _signalFilePathsToNotify.Add(fullPath);
- }
- }
- });
- }
-
- return VSConstants.S_OK;
- }
- }
-}
diff --git a/tooling/Microsoft.VisualStudio.BlazorExtension/Microsoft.VisualStudio.BlazorExtension.csproj b/tooling/Microsoft.VisualStudio.BlazorExtension/Microsoft.VisualStudio.BlazorExtension.csproj
index db47e2e98a..5f9967ee0f 100644
--- a/tooling/Microsoft.VisualStudio.BlazorExtension/Microsoft.VisualStudio.BlazorExtension.csproj
+++ b/tooling/Microsoft.VisualStudio.BlazorExtension/Microsoft.VisualStudio.BlazorExtension.csproj
@@ -4,7 +4,6 @@
15.0
$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
true
-
false
false
@@ -164,7 +163,6 @@
false
-
-
-
-
+
-
-
-
+
false
-
-
-
-
<_GeneratedVSIXAssemblyInfoInputsCacheFile>$(IntermediateOutputPath)$(MSBuildProjectName).VSIXAssemblyInfo.cache.txt