1

アプリケーションをローカルで起動するとすべて正常に動作しますが、ファイル共有にコピーするとすぐに次の例外が発生します。

Anwendung: WWW.exe
Frameworkversion: v4.0.30319
Beschreibung: Der Prozess wurde aufgrund einer unbehandelten Ausnahme beendet.
Ausnahmeinformationen: System.TypeInitializationException
Stapel:
   bei WWW.exe.Client.App.Application_Startup(System.Object, System.Windows.StartupEventArgs)
   bei System.Windows.Application.<.ctor>b__1(System.Object)
   bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   bei MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   bei System.Windows.Threading.Dispatcher.WrappedInvoke(System.Delegate, System.Object, Int32, System.Delegate)
   bei System.Windows.Threading.DispatcherOperation.InvokeImpl()
   bei System.Threading.ExecutionContext.runTryCode(System.Object)
   bei System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode, CleanupCode, System.Object)
   bei System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   bei System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   bei System.Windows.Threading.DispatcherOperation.Invoke()
   bei System.Windows.Threading.Dispatcher.ProcessQueue()
   bei System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   bei MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
   bei MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
   bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
   bei MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
   bei System.Windows.Threading.Dispatcher.WrappedInvoke(System.Delegate, System.Object, Int32, System.Delegate)
   bei System.Windows.Threading.Dispatcher.InvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
   bei MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
   bei MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
   bei System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
   bei System.Windows.Application.RunInternal(System.Windows.Window)
   bei System.Windows.Application.Run()
   bei WWW.exe.Client.App.Main()

ここで何が間違っている可能性がありますか?

編集: メソッド全体を try catch ブロックにラップしましたが、最初の行がヒットする前にクラッシュが発生します。

 void Application_Startup(object sender, StartupEventArgs e)
        {
            try
            {
                Application_Startup_Internal(sender, e);
            }
            catch (Exception exception)
            {
                Tracer.Write(exception); // writes the exception to the event log.
                throw;
            }
        }

編集 2: このブログ投稿で言及されているアイデアを試しました: http://social.msdn.microsoft.com/Forums/vstudio/en-US/3e05d960-9bba-496b-bf42-9608b94f3c10/debugdiagnostics-intialization-failed-after- installation-security-patch-kb2840628 とこれで問題が解決しました。しかし、それはすべての診断を削除しなければならないことを意味しますが、もちろんそれはできません。

4

1 に答える 1

1

この問題は、.NET 4.0 http://support.microsoft.com/kb/2840628/en-usの更新での不適切な最適化が原因でした。記事で説明されているように、更新プログラムhttp://support.microsoft.com/kb/2872041/en-usをインストールすることで修正できます。

于 2013-07-26T13:31:00.470 に答える