0

使用 ClickOnce 将 WPF 应用程序发布到中心位置后,当用户尝试访问该应用程序时出现以下异常。还有其他应用程序,它们适用于他们,问题仅在他们访问特定应用程序时。

我无法锻炼为什么会这样,因此异常似乎没有太大帮助。

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
4

1 回答 1

0

现在已修复。以下是上述问题的解决方案。

应用程序在下载后和启动前崩溃。为了准确指出,我附上DispatcherUnhandedException了处理程序以了解更多信息。通过以下操作,我能够从日志文件中确定确切的异常。就我而言,这与虚拟机配置文件权限有关。你的情况可能完全不同。但是,这种方法将帮助您过滤根本原因。

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

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();

        }
于 2013-11-11T09:50:04.437 回答