From de4d78f454357b84be158850f6f988e9850bdec1 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Wed, 4 Apr 2018 12:31:43 +0100 Subject: [PATCH] Only trigger live reloading from VS when enabled in MSBuild --- .../LiveReloadBuildWatcher.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tooling/Microsoft.VisualStudio.BlazorExtension/LiveReloadBuildWatcher.cs b/tooling/Microsoft.VisualStudio.BlazorExtension/LiveReloadBuildWatcher.cs index eff9168477..da487b4ed7 100644 --- a/tooling/Microsoft.VisualStudio.BlazorExtension/LiveReloadBuildWatcher.cs +++ b/tooling/Microsoft.VisualStudio.BlazorExtension/LiveReloadBuildWatcher.cs @@ -94,10 +94,12 @@ namespace Microsoft.VisualStudio.BlazorExtension 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.IsNullOrEmpty(projectDir) + if (string.Equals(useLiveReloading, "true", StringComparison.Ordinal) + && !string.IsNullOrEmpty(projectDir) && !string.IsNullOrEmpty(outputPath) && !string.IsNullOrEmpty(signalFilePath)) {