Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tmat committed Sep 11, 2024
1 parent 624befe commit e558486
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/BuiltInTools/DotNetDeltaApplier/StartupHook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ public static void Initialize()
// When launching the application process dotnet-watch sets Hot Reload environment variables via CLI environment directives (dotnet [env:X=Y] run).
// Currently, the CLI parser sets the env variables to the dotnet.exe process itself, rather then to the target process.
// This may cause the dotnet.exe process to connect to the named pipe and break it for the target process.
if (!string.Equals(
Path.ChangeExtension(processPath, ".exe"),
Path.ChangeExtension(s_targetProcessPath, ".exe"),
Path.PathSeparator == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal))
var processExe = Path.ChangeExtension(processPath, ".exe");
var expectedExe = Path.ChangeExtension(s_targetProcessPath, ".exe");
if (!string.Equals(processExe, expectedExe, Path.DirectorySeparatorChar == '\\' ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal))
{
Log($"Ignoring process '{processExe}', expecting '{expectedExe}'");
return;
}
{
Log($"Ignoring process '{processPath}', expecting '{s_targetProcessPath}'");
return;
Expand Down

0 comments on commit e558486

Please sign in to comment.