Describe the bug
When launching the published Release version (.exe) of the application, the application process starts in the background (visible in Task Manager) but no window or UI ever appears on the screen. The app hangs silently and indefinitely without throwing an exception or logging any error events to the Windows Event Viewer.
To Reproduce
Steps to reproduce the behaviour:
- Publish the WPF application using the Release configuration.
- Navigate to the published output folder.
- Double-click the published application executable file (
.exe).
- Observe that the process runs in the background but no window opens.
Expected behaviour
The published application should initialize quickly, load user configuration settings via Jot, and display the MainWindow shell immediately upon launch, matching the behaviour seen during local IDE Debug execution.
Additional context
The issue is a classic async/sync deadlock between the Prism framework lifecycle and the HandyControl theme framework.
During the instantiation of MainWindowViewModel, Jot maps user settings which triggers CultureUtils.GetCultureInfoByLanguage(). This method eagerly referenced HandyControl.Tools.ConfigHelper.Instance.SetLang().
Because HandyControl initializes its singleton via a static .Value call on a Lazy<T> wrapper, it instantly tries to evaluate Application.Current.Dispatcher.Thread. In highly optimized production Release builds, this happens before the underlying WPF Win32 message loop is fully pump-primed, trapping the Main thread in an infinite WaitHandle synchronization lock.
Describe the bug
When launching the published Release version (
.exe) of the application, the application process starts in the background (visible in Task Manager) but no window or UI ever appears on the screen. The app hangs silently and indefinitely without throwing an exception or logging any error events to the Windows Event Viewer.To Reproduce
Steps to reproduce the behaviour:
.exe).Expected behaviour
The published application should initialize quickly, load user configuration settings via Jot, and display the
MainWindowshell immediately upon launch, matching the behaviour seen during local IDE Debug execution.Additional context
The issue is a classic async/sync deadlock between the Prism framework lifecycle and the HandyControl theme framework.
During the instantiation of
MainWindowViewModel, Jot maps user settings which triggersCultureUtils.GetCultureInfoByLanguage(). This method eagerly referencedHandyControl.Tools.ConfigHelper.Instance.SetLang().Because HandyControl initializes its singleton via a static
.Valuecall on aLazy<T>wrapper, it instantly tries to evaluateApplication.Current.Dispatcher.Thread. In highly optimized production Release builds, this happens before the underlying WPF Win32 message loop is fully pump-primed, trapping the Main thread in an infiniteWaitHandlesynchronization lock.