.Net Application Cannot Start and Receive Xamlparseexception

.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.

  1. Install procmon.exe from https://learn.microsoft.com/en-us/sysinternals/downloads/procmon
  2. run the procmon.exe and add filter(process name contains ). press add.
  3. Start your app
  4. Verify the procman entries and look for FileNotFound/PathNotFound in Result column. Hope you will find the root cause here.


Related Topics



Leave a reply



Submit