Host UI errors (dotnet/core-setup#4844)
authorVitek Karas <vitek.karas@microsoft.com>
Tue, 18 Dec 2018 21:23:53 +0000 (13:23 -0800)
committerGitHub <noreply@github.com>
Tue, 18 Dec 2018 21:23:53 +0000 (13:23 -0800)
commitc2da8b2c52b6c1fa628affbf2bb353103b495307
treeafb167baa5cd076095960635f3a397c7bc3a6c2b
parent867569b05b61397fb478a600bfa6329434f11fa3
Host UI errors (dotnet/core-setup#4844)

Implements reporting errors with message box for Windows GUI apps in apphost.

In apphost, if it's running as GUI, error writing will be redirected to a buffer. Upon exit, if the error buffer is not empty, it will be showed on screen as a message box.
The error writer is propagated from apphost to hostfxr and thus to hostpolicy.

This solves the problem that GUI apps which don't have console die silently without reporting any errors if there are issues during host execution.

Commit migrated from https://github.com/dotnet/core-setup/commit/c90e8d7ee0ad11b9ac23967dad606afb2f86acaf
src/installer/corehost/cli/fxr/hostfxr.cpp
src/installer/corehost/common/pal.h
src/installer/corehost/common/trace.cpp
src/installer/corehost/common/utils.h
src/installer/corehost/corehost.cpp
src/installer/test/HostActivationTests/GivenThatICareAboutStandaloneAppActivation.cs
src/installer/test/HostActivationTests/HostActivationTests.csproj
src/installer/test/TestUtils/AppHostExtensions.cs
src/installer/test/TestUtils/Assertions/CommandResultAssertions.cs
src/installer/test/TestUtils/Command.cs