ClickOnce相关

时间:2013-11-11 08:39:36

标签: wpf clickonce

使用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

1 个答案:

答案 0 :(得分: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();

        }