WPF Application doesn't work on some machines:

2020-04-05 09:31发布

问题:

My WPF application works fine on a number of machines, but now I get a report about this error on a user machine:

Description:
  Stopped working

Problem signature:
  Problem Event Name:    CLR20r3
  Problem Signature 01:    mysoftware.exe
  Problem Signature 02:    1.0.0.1
  Problem Signature 03:    4bbcd9d9
  Problem Signature 04:    PresentationFramework
  Problem Signature 05:    3.0.0.0
  Problem Signature 06:    4a174fbc
  Problem Signature 07:    624f
  Problem Signature 08:    e1
  Problem Signature 09:    System.Windows.Markup.XamlParse
  OS Version:    6.1.7600.2.0.0.256.48
  Locale ID:    1033

I was trying to catch Exception using Application DispatcherUnhandledException but this didn't help. And warping Window1 constructor in try/catch block too. .NET Framework 3.5 is installed on that machine.

How can I figure out the reason of crashing: log this error, debug, ...?

回答1:

Just verify you have installed .Net Framework 3.5sp1.



回答2:

The fact that there is a mention of XAML parsing would lead me to check whether the XAML is corrupt on that particular machine. The easiest way to check it is well formed is to rename it to .xml and open it with Internet Explorer. (Even if it is well formed it could still have a problem of some sort.)

If it is a ClickOnce deployed app, I would suggest clearing the local cache of the application and relaunching to see if this clears the problem up.



回答3:

I think the main issue is the fact that the XAML file cannot be loaded.

That can stem from several problems:

  • Is the file meant to be deployed alongside the dll? Is it present
  • Is the client using a different UI culture than the others? Are there any satellite assemblies?
  • What version of the .Net framework is installed? Is it perchance a Client Profile only install?

Cheers!