Question

After publishing a WPF application to a central location using ClickOnce, I am getting following exception when user tries to access the application. There are other applications, which works fine for them and issue is only when they access a particular application.

I can't workout why this hence the exception doesn't seems to be very helpful.

Problem signature:
  Problem Event Name:   CLR20r3
  Problem Signature 01: KG0SYKVDCXEI452K403RIQ4BNPUF3BQA
  Problem Signature 02: 1.0.0.0
  Problem Signature 03: 528094d2
  Problem Signature 04: System.Data
  Problem Signature 05: 4.0.0.0
  Problem Signature 06: 4dd23ac7
  Problem Signature 07: 24da
  Problem Signature 08: 2c
  Problem Signature 09: System.Windows.Markup.XamlParse
  OS Version:   6.1.7601.2.1.0.256.48
  Locale ID:    2057
  Additional Information 1: 0a9e
  Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
  Additional Information 3: 0a9e
  Additional Information 4: 0a9e372d3b4ad19135b953a78882e789

Read our privacy statement online:
  http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
  C:\Windows\system32\en-US\erofflps.txt
Was it helpful?

Solution

This is fixed now. Following is the solution for the mentioned issue.

Application was crashing after downloading and before starting up. In order to pin point, I enclosed DispatcherUnhandedException handler to know more about it. With following in place, I was able to nail down the exact exception from the log file. In my case, it was to do with virtual machine profile permission. It might be totally different in your case. However, this approach will give you a helping hand to filter the root cause.

<Application x:Class="xxxxxxxx.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             StartupUri="MainWindow.xaml" DispatcherUnhandledException="ApplicationDispatcherUnhandledException">

and

void ApplicationDispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
        {

            var theException = e.Exception;
            var theErrorPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) +"\\IntraDataCopyError.txt";
            using (System.IO.TextWriter theWriter = new System.IO.StreamWriter(theErrorPath, true))
            {
                var theNow = DateTime.Now;
                theWriter.WriteLine("Error log at : " + theNow.ToShortDateString() + " " + theNow.ToShortTimeString());
                while (theException != null)
                {
                    theWriter.WriteLine("Exception: " + theException);
                    theException = theException.InnerException;
                }
            }
            MessageBox.Show("The program aborted due to following issue.\n" + theErrorPath);
            e.Handled = true;
            Application.Current.Shutdown();

        }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top