Skip to content

Commit eacb57b

Browse files
authored
Ensure file-based apps' csc uses correct dotnet (#50811)
1 parent 0439a83 commit eacb57b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Cli/dotnet/Commands/Run/CSharpCompilerCommand.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ public int Execute(out bool fallbackToNormalBuild)
7272
// Write .rsp file and other intermediate build outputs.
7373
PrepareAuxiliaryFiles(out string rspPath);
7474

75+
// Ensure the compiler is launched with the correct dotnet.
76+
Environment.SetEnvironmentVariable("DOTNET_HOST_PATH", new Muxer().MuxerPath);
77+
7578
// Create a request for the compiler server
7679
// (this is much faster than starting a csc.dll process, especially on Windows).
7780
var buildRequest = BuildServerConnection.CreateBuildRequest(

0 commit comments

Comments
 (0)