有人可以根据提供的信息帮助理解 .Net Runtime Exception Info: System.TypeLoadException 的原因吗?
Can someone assist in understanding the cause of .Net Runtime Exception Info: System.TypeLoadException based on info provided?
我有一个应用程序正在触发 .Net 运行时异常信息:System.TypeLoadException 然后在尝试启动时崩溃。我试图卸载应用程序并重新安装。我确实发现这一切都是在它更新的时候开始的。我没有尝试回滚到以前的版本,只是更新到有效的测试版。如果允许,附带问题是否有任何推荐材料可以指导我理解这个错误?特别是如果它能给出一个相当好的分解。
更新:这不是我们的软件,我已经尝试联系供应商并再次等待回复。自更新以来,在我们所有用户中,只有 1 人遇到此问题和版本。
提前致谢。
Application: ndClickWinTray.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.TypeLoadException
at ndClickWinTray.NdClickTrayIcon.SetDelegates()
at ndClickWinTray.NdClickTrayIcon..ctor(ndClickWinTray.BusinessLogic.Infrastructure.Interfaces.IContainer, NetDocuments.Login.Contracts.Interfaces.IEventStream, NetDocuments.Login.Contracts.Interfaces.IUserAdapter, NetDocuments.Login.Contracts.Interfaces.IExceptionLogger, NetDocuments.Login.Contracts.Interfaces.IAuthenticationAdapter, NetDocuments.Login.Presentation.Infrastructure.IDialogFactory)
at DynamicClass.lambda_method(System.Runtime.CompilerServices.Closure)
at SimpleInjector.Lifestyles.SingletonLifestyle+SingletonLifestyleRegistration`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].CreateInstance(System.Func`1<System.__Canon>)
at SimpleInjector.Lifestyles.SingletonLifestyle+SingletonLifestyleRegistration`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].CreateInstanceWithNullCheck()
at SimpleInjector.Lifestyles.SingletonLifestyle+SingletonLifestyleRegistration`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].GetInterceptedInstance()
at SimpleInjector.Lifestyles.SingletonLifestyle+SingletonLifestyleRegistration`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].BuildExpression()
at SimpleInjector.InstanceProducer.BuildExpressionInternal()
at SimpleInjector.Internals.LazyEx`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].get_Value()
at SimpleInjector.InstanceProducer.BuildExpression()
Exception Info: SimpleInjector.ActivationException
at SimpleInjector.InstanceProducer.BuildExpression()
at SimpleInjector.InstanceProducer.VerifyExpressionBuilding()
Exception Info: System.InvalidOperationException
at SimpleInjector.InstanceProducer.VerifyExpressionBuilding()
at SimpleInjector.Container.VerifyThatAllExpressionsCanBeBuilt(SimpleInjector.InstanceProducer[])
at SimpleInjector.Container.VerifyThatAllExpressionsCanBeBuilt()
at SimpleInjector.Container.VerifyInternal(Boolean)
at SimpleInjector.Container.Verify(SimpleInjector.VerificationOption)
at ndClickWinTray.App.RegisterTypes()
at ndClickWinTray.App.OnStartup(System.Windows.StartupEventArgs)
at System.Windows.Application.<.ctor>b__1_0(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object)
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 MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, 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 System.Windows.Threading.ExceptionWrapper.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 System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
at System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
at System.Windows.Application.RunDispatcher(System.Object)
at System.Windows.Application.RunInternal(System.Windows.Window)
at System.Windows.Application.Run(System.Windows.Window)
at ndClickWinTray.App.Main()
at ndClickWinTray.Program.Main(System.String[])
这是您的应用程序还是第 3 方应用程序?
TypeLoad 异常通常发生在第 3 方引用最终不匹配时。
您已经暗示这是在更新后观察到的,这听起来像是预期的第 3 方 dll 但无法加载。
如果这是您的项目代码,请检查您是否已将所有 NuGet 引用合并到相同的版本,这是一个非常常见的问题。
您的特定问题因动态脚本编译的实现而变得复杂,因此我们不会在编译期间看到错误,只会在运行时看到错误。
同样,如果这是您的代码,您应该捕获异常并处理它,您可能会更深入地了解根本原因。
您是否阅读过 SO 上的这些帖子?:
- How to debug System.TypeLoadException errors in .NET?
- Im getting exception Typeload what the exception can be?
我有一个应用程序正在触发 .Net 运行时异常信息:System.TypeLoadException 然后在尝试启动时崩溃。我试图卸载应用程序并重新安装。我确实发现这一切都是在它更新的时候开始的。我没有尝试回滚到以前的版本,只是更新到有效的测试版。如果允许,附带问题是否有任何推荐材料可以指导我理解这个错误?特别是如果它能给出一个相当好的分解。
更新:这不是我们的软件,我已经尝试联系供应商并再次等待回复。自更新以来,在我们所有用户中,只有 1 人遇到此问题和版本。
提前致谢。
Application: ndClickWinTray.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.TypeLoadException
at ndClickWinTray.NdClickTrayIcon.SetDelegates()
at ndClickWinTray.NdClickTrayIcon..ctor(ndClickWinTray.BusinessLogic.Infrastructure.Interfaces.IContainer, NetDocuments.Login.Contracts.Interfaces.IEventStream, NetDocuments.Login.Contracts.Interfaces.IUserAdapter, NetDocuments.Login.Contracts.Interfaces.IExceptionLogger, NetDocuments.Login.Contracts.Interfaces.IAuthenticationAdapter, NetDocuments.Login.Presentation.Infrastructure.IDialogFactory)
at DynamicClass.lambda_method(System.Runtime.CompilerServices.Closure)
at SimpleInjector.Lifestyles.SingletonLifestyle+SingletonLifestyleRegistration`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].CreateInstance(System.Func`1<System.__Canon>)
at SimpleInjector.Lifestyles.SingletonLifestyle+SingletonLifestyleRegistration`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].CreateInstanceWithNullCheck()
at SimpleInjector.Lifestyles.SingletonLifestyle+SingletonLifestyleRegistration`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].GetInterceptedInstance()
at SimpleInjector.Lifestyles.SingletonLifestyle+SingletonLifestyleRegistration`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].BuildExpression()
at SimpleInjector.InstanceProducer.BuildExpressionInternal()
at SimpleInjector.Internals.LazyEx`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].get_Value()
at SimpleInjector.InstanceProducer.BuildExpression()
Exception Info: SimpleInjector.ActivationException
at SimpleInjector.InstanceProducer.BuildExpression()
at SimpleInjector.InstanceProducer.VerifyExpressionBuilding()
Exception Info: System.InvalidOperationException
at SimpleInjector.InstanceProducer.VerifyExpressionBuilding()
at SimpleInjector.Container.VerifyThatAllExpressionsCanBeBuilt(SimpleInjector.InstanceProducer[])
at SimpleInjector.Container.VerifyThatAllExpressionsCanBeBuilt()
at SimpleInjector.Container.VerifyInternal(Boolean)
at SimpleInjector.Container.Verify(SimpleInjector.VerificationOption)
at ndClickWinTray.App.RegisterTypes()
at ndClickWinTray.App.OnStartup(System.Windows.StartupEventArgs)
at System.Windows.Application.<.ctor>b__1_0(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object)
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 MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, 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 System.Windows.Threading.ExceptionWrapper.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 System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
at System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
at System.Windows.Application.RunDispatcher(System.Object)
at System.Windows.Application.RunInternal(System.Windows.Window)
at System.Windows.Application.Run(System.Windows.Window)
at ndClickWinTray.App.Main()
at ndClickWinTray.Program.Main(System.String[])
这是您的应用程序还是第 3 方应用程序?
TypeLoad 异常通常发生在第 3 方引用最终不匹配时。 您已经暗示这是在更新后观察到的,这听起来像是预期的第 3 方 dll 但无法加载。
如果这是您的项目代码,请检查您是否已将所有 NuGet 引用合并到相同的版本,这是一个非常常见的问题。
您的特定问题因动态脚本编译的实现而变得复杂,因此我们不会在编译期间看到错误,只会在运行时看到错误。
同样,如果这是您的代码,您应该捕获异常并处理它,您可能会更深入地了解根本原因。
您是否阅读过 SO 上的这些帖子?:
- How to debug System.TypeLoadException errors in .NET?
- Im getting exception Typeload what the exception can be?