You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is basically a duplicate of #69023, but I can't re-open that issue, so I logging a new one.
The latest builds of .NET 8 Preview7 are now broken if you xcopy/unzip/untar the bits to some dotnet "hive" that is not on the $PATH. This scenario needs to work.
Repro Steps
Have a machine with .NET 7 installed in %PROGRAMFILES%
C:\dotnet\dotnet.exe new console
C:\dotnet\dotnet.exe build
Expected results
The build should succeed
Actual results
C:\dotnet\sdk\8.0.100-rc.1.23371.3\Roslyn\Microsoft.CSharp.Core.targets(80,5): error : You must install or update .NET to run this application. [C:\Do
tNetTest\Net8Console\Net8Console.csproj]
C:\dotnet\sdk\8.0.100-rc.1.23371.3\Roslyn\Microsoft.CSharp.Core.targets(80,5): error : [C:\DotNetTest\Net8Console\Net8Console.csproj]
C:\dotnet\sdk\8.0.100-rc.1.23371.3\Roslyn\Microsoft.CSharp.Core.targets(80,5): error : App: C:\dotnet\sdk\8.0.100-rc.1.23371.3\Roslyn\bincore\csc.dll
[C:\DotNetTest\Net8Console\Net8Console.csproj]
C:\dotnet\sdk\8.0.100-rc.1.23371.3\Roslyn\Microsoft.CSharp.Core.targets(80,5): error : Architecture: x64 [C:\DotNetTest\Net8Console\Net8Console.csproj
]
C:\dotnet\sdk\8.0.100-rc.1.23371.3\Roslyn\Microsoft.CSharp.Core.targets(80,5): error : Framework: 'Microsoft.NETCore.App', version '8.0.0-preview.7.23
368.2' (x64) [C:\DotNetTest\Net8Console\Net8Console.csproj]
C:\dotnet\sdk\8.0.100-rc.1.23371.3\Roslyn\Microsoft.CSharp.Core.targets(80,5): error : .NET location: C:\Program Files\dotnet\ [C:\DotNetTest\Net8Cons
ole\Net8Console.csproj]
C:\dotnet\sdk\8.0.100-rc.1.23371.3\Roslyn\Microsoft.CSharp.Core.targets(80,5): error : [C:\DotNetTest\Net8Console\Net8Console.csproj]
C:\dotnet\sdk\8.0.100-rc.1.23371.3\Roslyn\Microsoft.CSharp.Core.targets(80,5): error : The following frameworks were found: [C:\DotNetTest\Net8Console
\Net8Console.csproj]
C:\dotnet\sdk\8.0.100-rc.1.23371.3\Roslyn\Microsoft.CSharp.Core.targets(80,5): error : 3.1.32 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.A
pp] [C:\DotNetTest\Net8Console\Net8Console.csproj]
C:\dotnet\sdk\8.0.100-rc.1.23371.3\Roslyn\Microsoft.CSharp.Core.targets(80,5): error : 6.0.0-preview.5.21301.5 at [C:\Program Files\dotnet\shared\Mi
crosoft.NETCore.App] [C:\DotNetTest\Net8Console\Net8Console.csproj]
C:\dotnet\sdk\8.0.100-rc.1.23371.3\Roslyn\Microsoft.CSharp.Core.targets(80,5): error : 6.0.19 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.A
pp] [C:\DotNetTest\Net8Console\Net8Console.csproj]
C:\dotnet\sdk\8.0.100-rc.1.23371.3\Roslyn\Microsoft.CSharp.Core.targets(80,5): error : 6.0.20 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.A
pp] [C:\DotNetTest\Net8Console\Net8Console.csproj]
C:\dotnet\sdk\8.0.100-rc.1.23371.3\Roslyn\Microsoft.CSharp.Core.targets(80,5): error : 7.0.8 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.Ap
p] [C:\DotNetTest\Net8Console\Net8Console.csproj]
C:\dotnet\sdk\8.0.100-rc.1.23371.3\Roslyn\Microsoft.CSharp.Core.targets(80,5): error : 7.0.9 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.Ap
p] [C:\DotNetTest\Net8Console\Net8Console.csproj]
C
Original issue
At the moment this behavior is "By Design". The compiler will use the `dotnet` which is available on `$PATH`.
Various parts of dotnet/sdk seem to set the DOTNET_HOST_PATH environment variable, and this is no longer being used.
That is an implementation detail of our internal architecture that leaked into the shipping product. Very confident our conclusion is going to be that this needs to be removed from the product.
If you feel a better appproach is in order here please put the discussion on dotnet/runtime#88754. That is the design we are following here.
* Enable building with a dotnet not on PATH
In #68918 we removed inspecting DOTNET_HOST_PATH environment variable. This broke the scenario where a specific dotnet "hive" was installed to a location not on the PATH.
When the .NET SDK commands invoke a sub-process (for example MSBuild), it sets the DOTNET_HOST_PATH environment variable to tell the sub-process "this is where the dotnet.exe that invoked this command is located". See #21237 and dotnet/cli#7311 for more info.
This change reverts the behavior back to respect DOTNET_HOST_PATH, and if it isn't set it will just use "dotnet" and let the OS take care of finding the executable on the PATH.
Fix#69150
* Fix tests to workaround MSBuild searching the PATH itself.
* Respond to PR feedback.
Make the change smaller until @jaredpar gets back. Only make the minimal change required, which is to check DOTNET_HOST_PATH.
This is basically a duplicate of #69023, but I can't re-open that issue, so I logging a new one.
The latest builds of .NET 8 Preview7 are now broken if you xcopy/unzip/untar the bits to some dotnet "hive" that is not on the
$PATH
. This scenario needs to work.Repro Steps
C:\dotnet
.Expected results
The build should succeed
Actual results
Original issue
That is an implementation detail of our internal architecture that leaked into the shipping product. Very confident our conclusion is going to be that this needs to be removed from the product.
If you feel a better appproach is in order here please put the discussion on dotnet/runtime#88754. That is the design we are following here.
Originally posted by @jaredpar in #69023 (comment)
The text was updated successfully, but these errors were encountered: