dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.26k stars 4.73k forks source link

Improve AppHost to display the startup exceptions (such as assembly dependency error) #104768

Open Flithor opened 3 months ago

Flithor commented 3 months ago

Summary

We have a project always updates some components, but not every update will be rigorously verified the assembly version and deps.json. If there is a major change, it may have a program assembly dependency error and break down. This error is occurred before enter the assembly entry (Main method), so program code cannot capture it.

However, the current AppHost does not show exception message by eye-catching way when startup like on Linux terminal, but only writes the exception into the Windows system log silently, which causes some trouble. Although we know that we can take the cause of the startup failure by viewing the Windows system log, it is still a barrier for non-technical personnel. Then they complain that the program has no eye-catching message tell them how to do next (although they know to seek technical assistance).

User Impact

I hope there can be an optional function that allows AppHost.exe to output exception message by a message box (for desktop app) or in a not auto closed terminal window when the assembly dependency error occurred.

dotnet-policy-service[bot] commented 3 months ago

Tagging subscribers to this area: @vitek-karas, @agocke, @vsadov See info in area-owners.md if you want to be subscribed.