From 627b730d67542ae800de690c595ca2d4075b5a64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Herceg?= Date: Thu, 12 May 2022 12:30:23 +0200 Subject: [PATCH 1/3] Hot reload ignores TMP files created by Visual Studio --- .../Common/HotReloadMarkupFileLoader.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Tools/HotReload/Common/HotReloadMarkupFileLoader.cs b/src/Tools/HotReload/Common/HotReloadMarkupFileLoader.cs index 7f44badfad..c20ed572b5 100644 --- a/src/Tools/HotReload/Common/HotReloadMarkupFileLoader.cs +++ b/src/Tools/HotReload/Common/HotReloadMarkupFileLoader.cs @@ -40,7 +40,10 @@ public HotReloadMarkupFileLoader(DefaultMarkupFileLoader defaultMarkupFileLoader watcher.Changed += (s, a) => OnFileChanged(configuration, a.FullPath); watcher.Renamed += (s, a) => { // VS doesn't update the actual file, it writes in the temp file, moves the old file away, and then renames the temp file to the original file - OnFileChanged(configuration, a.FullPath); + if (!string.Equals(Path.GetExtension(a.FullPath), ".tmp", StringComparison.OrdinalIgnoreCase)) + { + OnFileChanged(configuration, a.FullPath); + } }; watcher.EnableRaisingEvents = true; return watcher; @@ -54,8 +57,15 @@ private void OnFileChanged(DotvvmConfiguration configuration, string fullPath) Task.Factory.StartNew(() => { // cannot use DI - there is cyclic dependency - var controlBuilderFactory = configuration.ServiceProvider.GetRequiredService(); - controlBuilderFactory.GetControlBuilder(fullPath); + try + { + var controlBuilderFactory = configuration.ServiceProvider.GetRequiredService(); + controlBuilderFactory.GetControlBuilder(fullPath); + } + catch (Exception) + { + // ignore errors - this is triggered on the background so the subsequent HTTP request from the browser will have the page already compiled + } }); // notify about the changes From 66cd64a485594fc85b73dc153df7278ffeb86778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrej=20=C4=8Ci=C5=BEm=C3=A1rik?= Date: Wed, 7 Sep 2022 12:20:08 +0200 Subject: [PATCH 2/3] Hopefully fixed CommandLine publishing --- src/Tools/CommandLine/DotVVM.CommandLine.nuspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tools/CommandLine/DotVVM.CommandLine.nuspec b/src/Tools/CommandLine/DotVVM.CommandLine.nuspec index 78102de729..8e6255a507 100644 --- a/src/Tools/CommandLine/DotVVM.CommandLine.nuspec +++ b/src/Tools/CommandLine/DotVVM.CommandLine.nuspec @@ -9,6 +9,6 @@ - + From 71c17c93c81922d3593903a76498befddbbb97b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrej=20=C4=8Ci=C5=BEm=C3=A1rik?= Date: Wed, 7 Sep 2022 12:20:08 +0200 Subject: [PATCH 3/3] Hopefully fixed CommandLine publishing --- src/Tools/CommandLine/DotVVM.CommandLine.csproj | 2 +- src/Tools/CommandLine/DotVVM.CommandLine.nuspec | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Tools/CommandLine/DotVVM.CommandLine.csproj b/src/Tools/CommandLine/DotVVM.CommandLine.csproj index 0c4ce832fa..c2775ba7b8 100644 --- a/src/Tools/CommandLine/DotVVM.CommandLine.csproj +++ b/src/Tools/CommandLine/DotVVM.CommandLine.csproj @@ -102,7 +102,7 @@ - + @(NuspecProperty, ';') diff --git a/src/Tools/CommandLine/DotVVM.CommandLine.nuspec b/src/Tools/CommandLine/DotVVM.CommandLine.nuspec index 78102de729..8e6255a507 100644 --- a/src/Tools/CommandLine/DotVVM.CommandLine.nuspec +++ b/src/Tools/CommandLine/DotVVM.CommandLine.nuspec @@ -9,6 +9,6 @@ - +