I created a C# WPF application with Visual Studio 2015. On my computer everything works fine. But no one else can start the application. Even only with the .exe, the .exe in the Debug folder or when I publish the software and they install it.
I tried a few things:
The software needs a special folder on the desktop to work; I tried this out and it builds the path with Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
so this won't cause the problem.
Additionally I use a database in my program but I declared the database in the code and tried it on my own pc by cutting the network connection. It works, so the missing connection is not the problem. The program has a navigation window with three pages, so I made this
public MainWindow()
{
try
{
InitializeComponent();
}
catch (Exception ex) {
MessageBox.Show(ex.InnerException.ToString());
}
}
but no MessageBox
is shown. Even the thread can´t be found in the task manager. It seems that it doesn't start. The OS on all the PCs is Win 10.
Does anyone know what the issue here is?
EDIT:
I found the following error message in the Windows Event Viewer.
System.IO.FileNotFoundException
bei MMS.CustomAcrobatCtrl.InitializeComponent()
bei MMS.CustomAcrobatCtrl..ctor()
bei MMS.WpfAcrobatCtrl..ctor()
I made a custom PDF viewer and it seems that it can´t be loaded for some reasons, or am i wrong?
You should check the Windows Event Viewer logs for any .NET Runtime related logged issues.
Otherwise, you should add the event handlers for the following events in your App.xaml.cs
.
AppDomain.CurrentDomain.UnhandledException
Application.Current.DispatcherUnhandledException
TaskScheduler.UnobservedTaskException
You can do the same thing you are doing now - showing a MessageBox
except rather use ex.ToString()
instead of ex.InnerException.ToString()
as often ex.InnerException
is null
.
I know this is an old issue, but a I faced the same problem. The following solution gave me more information to pinpoint my problem.
Your application now starts with a console window (CMD.exe). If there is an exception, this will be showed in the console window. The exception shows line numbers and module names as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With