.NET application cannot start and receive XamlParseException
XamlParseException
is the generic error that happens when there is a problem at application start. I suggest you modify you application startup code to trace what's really going on and get, not only the XamlParseException, but also the inner exception(s) which should help you determine the root of the problem. Here is an example:
namespace WpfApplication1
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
// hook on error before app really starts
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
base.OnStartup(e);
}
void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
// put your tracing or logging code here (I put a message box as an example)
MessageBox.Show(e.ExceptionObject.ToString());
}
}
}
XamlParseException after deleting settings (app.config)
Woot, i found a problem, this is a good advice: https://stackoverflow.com/a/7857728/1808239
My settings.Fields.ProgramLanguage was a null, but not a ""
WPF Application dosen't start
Have you tried procmon.exe to verify whats going on?
I had the similar issue and figured out with procman. and the issue was a missing dll which exists in my machine but not on other machine.
- Install procmon.exe from https://learn.microsoft.com/en-us/sysinternals/downloads/procmon
- run the procmon.exe and add filter(process name contains ). press add.
- Start your app
- Verify the procman entries and look for FileNotFound/PathNotFound in Result column. Hope you will find the root cause here.
Related Topics
C#: Detecting Which Application Has Focus
Interaction Between Webbrowser Control and Windows Forms
The Entity or Complex Type ' ' Cannot Be Constructed in a Linq to Entities Query
Asynchronous Iterator Task<Ienumerable<T>>
C# Code to Linkify Urls in a String
Get Application's Window Handles
Working with Appdomain.Assemblyresolve Event
Controls in Container Form Come Over Child Form
Simulating Keyboard with Sendinput API in Directinput Applications
How to Add the Same Column to All Entities in Ef Core
How to Dispose of a Backgroundworker
Open Link in New Tab (Webbrowser Control)