An exception is not thrown when the program is installed with the msi file

I created a WPF program that runs in the VIsual studio at startup. I made an installer for my program with Visual Installer Projects 2017. On the one hand, the program worked, and I got the following dialog:

An unhandled Microsoft.NET Framework exception occured in Program1.exe [10204].

My catch block is as follows

Dispatcher.Invoke(new Action(() =>
            {
                EnableContent();
            }));
        }
        catch (AggregateException e)
        {
            MessageBox.Show(e.ToString());
            Dispatcher.Invoke(new Action(() =>
            {
                UpdateLoadMsg("No internet connection.", MsgType.FAIL);
            }));
        }
        catch (Exception e)
        {
            MessageBox.Show(e.ToString());
            Dispatcher.Invoke(new Action(() =>
            {
                UpdateLoadMsg("Something went wrong.", MsgType.FAIL);
            }));
        }

Messagebox never displays! apparently the exception does not get. I don’t know how to debug this if there is no way to debug it!

+6
source share
1 answer

Relevant

I found the causing exception by looking at the system logs http://www.dummies.com/computers/operating-systems/windows-10/how-to-use-event-viewer-in-windows-10/ .

irrelevant

FileNotFoundException. buildaction = embedded resource was not enough, .

+2

Source: https://habr.com/ru/post/1016861/


All Articles