-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dotnet.exe prints error messages to console when launched with empty DOTNET_MULTILEVEL_LOOKUP via start process #54073
Comments
Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov Issue DetailsDescriptionIt appears dotnet.exe is printing some garbage error message text to stdout whenever it's confused by the setting of the DOTNET_MULTILEVEL_LOOKUP environment variable. I hit this under msbuild, but it's likely caused any time a managed program launches dotnet.exe and sets DOTNET_MULTILEVEL_LOOKUP to empty string in the StartInfo.EnvironmentVariables The errors seem to come from dotnet.exe itself. The exact build of dotnet.exe i was using is provided below. Repro at https://github.com/aaronla-ms/bug-repros/tree/main/repro-msbuild-envvars-exec
expected: actual:
Configuration
Regression?Uncertain. Other information
|
Just for ease of access - the simplest repro (note that it's the easiest way since MSBuild is easy to run, could be done via .NET as well if necessary): <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<Target Name="Custom" BeforeTargets="BeforeBuild">
<Exec Command="dotnet --info" EnvironmentVariables="DOTNET_MULTILEVEL_LOOKUP=" />
</Target>
</Project> Create a Failed to read environment variable [DOTNET_MULTILEVEL_LOOKUP], HRESULT: 0x80070002
Failed to read environment variable [DOTNET_MULTILEVEL_LOOKUP], HRESULT: 0x800700CB
Failed to read environment variable [DOTNET_MULTILEVEL_LOOKUP], HRESULT: 0x800700CB
.NET SDK (reflecting any global.json):
Version: 6.0.100-preview.5.21226.1
Commit: db05c9234e
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19043
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.100-preview.5.21226.1\
Failed to read environment variable [DOTNET_MULTILEVEL_LOOKUP], HRESULT: 0x0
Failed to read environment variable [DOTNET_MULTILEVEL_LOOKUP], HRESULT: 0x80070012 There are several issues with the code in the host around this:
What needs to happen:
Note: |
Description
It appears dotnet.exe is printing some garbage error message text to stdout whenever it's confused by the setting of the DOTNET_MULTILEVEL_LOOKUP environment variable. I hit this under msbuild, but it's likely caused any time a managed program launches dotnet.exe and sets DOTNET_MULTILEVEL_LOOKUP to empty string in the StartInfo.EnvironmentVariables (reference dotnet/msbuild/blob/main/src/Utilities/ToolTask.cs)
The errors seem to come from dotnet.exe itself. The exact build of dotnet.exe i was using is provided below.
Repro at https://github.com/aaronla-ms/bug-repros/tree/main/repro-msbuild-envvars-exec
expected:
no errors logged to console
actual:
weird errors logged to console,
Failed to read environment variable [DOTNET_MULTILEVEL_LOOKUP], HRESULT: 0x800700CB
. Full text:Configuration
Regression?
Uncertain.
Other information
The text was updated successfully, but these errors were encountered: