未验证 提交 bed1eb9e 编写于 作者: G github-actions[bot] 提交者: GitHub

[release/6.0-staging] dotnet.exe prints error messages to console when...

[release/6.0-staging] dotnet.exe prints error messages to console when launched with empty DOTNET_MULTILEVEL_LOOKUP (#88664)
上级 4e5aac82
......@@ -322,7 +322,8 @@ public void AppHost_FrameworkDependent_GlobalLocation_Succeeds(bool useRegistere
.Execute()
.Should().Pass()
.And.HaveStdOutContaining("Hello World")
.And.HaveStdOutContaining(sharedTestState.RepoDirectories.MicrosoftNETCoreAppVersion);
.And.HaveStdOutContaining(sharedTestState.RepoDirectories.MicrosoftNETCoreAppVersion)
.And.NotHaveStdErr();
// Verify running from within the working directory
Command.Create(appExe)
......@@ -336,7 +337,8 @@ public void AppHost_FrameworkDependent_GlobalLocation_Succeeds(bool useRegistere
.Execute()
.Should().Pass()
.And.HaveStdOutContaining("Hello World")
.And.HaveStdOutContaining(sharedTestState.RepoDirectories.MicrosoftNETCoreAppVersion);
.And.HaveStdOutContaining(sharedTestState.RepoDirectories.MicrosoftNETCoreAppVersion)
.And.NotHaveStdErr();
}
}
......
......@@ -179,7 +179,8 @@ public void Muxer_activation_of_Empty_StartupHook_Variable_Succeeds()
.CaptureStdErr()
.Execute()
.Should().Pass()
.And.HaveStdOutContaining("Hello World");
.And.HaveStdOutContaining("Hello World")
.And.NotHaveStdErr();
}
// Run the app with a startup hook assembly that depends on assemblies not on the TPA list
......
......@@ -499,14 +499,18 @@ bool pal::getenv(const char_t* name, string_t* recv)
auto err = GetLastError();
if (err != ERROR_ENVVAR_NOT_FOUND)
{
trace::error(_X("Failed to read environment variable [%s], HRESULT: 0x%X"), name, HRESULT_FROM_WIN32(GetLastError()));
trace::warning(_X("Failed to read environment variable [%s], HRESULT: 0x%X"), name, HRESULT_FROM_WIN32(err));
}
return false;
}
auto buf = new char_t[length];
if (::GetEnvironmentVariableW(name, buf, length) == 0)
{
trace::error(_X("Failed to read environment variable [%s], HRESULT: 0x%X"), name, HRESULT_FROM_WIN32(GetLastError()));
auto err = GetLastError();
if (err != ERROR_ENVVAR_NOT_FOUND)
{
trace::warning(_X("Failed to read environment variable [%s], HRESULT: 0x%X"), name, HRESULT_FROM_WIN32(err));
}
return false;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册