gpt4 book ai didi

c# - WPF应用程序OnStartup出现System.IO.FileLoadException的原因

转载 作者:太空狗 更新时间:2023-10-29 21:54:32 24 4
gpt4 key购买 nike

我正在调试一个 WPF 应用程序,该应用程序在启动时因未处理的 System.IO.FileLoadException 而崩溃。

我使用了 Assembly Binding Log Viewer验证没有程序集加载错误,并且 OnStartup 重写中的所有代码都包含在 try catch 中。

排除了程序集绑定(bind)是异常的原因后,我还应该调查哪些其他可能的原因?

以下是相关的事件日志条目:


源为“ApplicationError”的第一个错误

Faulting application name: CompanyProductManager.exe, version: 4.2.0.0, time stamp: 0x514a20ba
Faulting module name: KERNELBASE.dll, version: 6.1.7601.18015, time stamp: 0x50b8479b
Exception code: 0xe0434352
Fault offset: 0x0000000000009e5d
Faulting process id: 0xf18
Faulting application start time: 0x01ce3c6ce70ee3f8
Faulting application path: C:\Users\My_User\AppData\Local\Apps\2.0\VJ12169A.3AG\6445EVK6.26Y\wmsd..tion_9fb3931a66281a0b_0004.0000_68586becb8f48f17\CompanyProductManager.exe
Faulting module path: C:\Windows\system32\KERNELBASE.dll
Report Id: 2588c97b-a860-11e2-be7c-3cd92b4a0af4

源“.NET Runtime”的第二个错误

Application: CompanyProductManager.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileLoadException
Stack:
at CompanySI.CompanyProduct.CompanyProductManager.App.OnStartup(System.Windows.StartupEventArgs)
at System.Windows.Application.<.ctor>b__1(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
at System.Windows.Application.RunInternal(System.Windows.Window)
at System.Windows.Application.Run()
at CompanySI.CompanyProduct.CompanyProductManager.App.Main()

最佳答案

在未启用验证跳过的机器上加载延迟签名的程序集会导致类似的错误。

关于c# - WPF应用程序OnStartup出现System.IO.FileLoadException的原因,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16091944/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com