Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Avoid potential NRE (#29128)
  • Loading branch information
tmat authored and marcpopMSFT committed Nov 18, 2022
commit 6bc8dafedc42cbceff7bdf0a7415e46951d6f3ff
8 changes: 6 additions & 2 deletions src/BuiltInTools/dotnet-watch/HotReloadDotNetWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,12 @@ private void ConfigureExecutable(DotNetWatchContext context, ProcessSpec process
processSpec.EnvironmentVariables["ASPNETCORE_URLS"] = context.LaunchSettingsProfile.ApplicationUrl;
}

var rootVariableName = Environment.Is64BitProcess ? "DOTNET_ROOT" : "DOTNET_ROOT(x86)";
if (string.IsNullOrEmpty(Environment.GetEnvironmentVariable(rootVariableName)))
var rootVariableName = EnvironmentVariableNames.TryGetDotNetRootVariableName(
project.RuntimeIdentifier ?? "",
project.DefaultAppHostRuntimeIdentifier ?? "",
project.TargetFrameworkVersion);

if (rootVariableName != null && string.IsNullOrEmpty(Environment.GetEnvironmentVariable(rootVariableName)))
{
processSpec.EnvironmentVariables[rootVariableName] = Path.GetDirectoryName(_muxerPath);
}
Expand Down