有人可以根据提供的信息帮助理解 .Net Runtime Exception Info: System.TypeLoadException 的原因吗?

如何解决有人可以根据提供的信息帮助理解 .Net Runtime Exception Info: System.TypeLoadException 的原因吗?

我有一个应用程序正在触发 .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,PublicKeyToken=b77a5c561934e089]].CreateInstanceWithNullCheck()
   at SimpleInjector.Lifestyles.SingletonLifestyle+SingletonLifestyleRegistration`1[[System.__Canon,PublicKeyToken=b77a5c561934e089]].GetInterceptedInstance()
   at SimpleInjector.Lifestyles.SingletonLifestyle+SingletonLifestyleRegistration`1[[System.__Canon,PublicKeyToken=b77a5c561934e089]].BuildExpression()
   at SimpleInjector.InstanceProducer.BuildExpressionInternal()
   at SimpleInjector.Internals.LazyEx`1[[System.__Canon,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,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,Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,System.Object)
   at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext,System.Object)
   at System.Windows.Threading.dispatcherOperation.Invoke()
   at System.Windows.Threading.dispatcher.ProcessQueue()
   at System.Windows.Threading.dispatcher.WndProcHook(IntPtr,IntPtr,Boolean ByRef)
   at MS.Win32.HwndWrapper.WndProc(IntPtr,Boolean ByRef)
   at MS.Win32.HwndSubclass.dispatcherCallbackOperation(System.Object)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate,System.Delegate)
   at System.Windows.Threading.dispatcher.LegacyInvokeImpl(System.Windows.Threading.dispatcherPriority,System.TimeSpan,Int32)
   at MS.Win32.HwndSubclass.SubclassWndProc(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[])

解决方法

这是您的应用程序还是第三方应用程序?

TypeLoad 异常通常在 3rd 方引用最终不匹配时发生。 您已经暗示这是在更新后观察到的,这听起来像是预期的 3rd 方 dll,但无法加载。

如果这是您的项目代码,请检查您是否已将所有 NuGet 引用合并到相同版本,这是一个非常常见的问题。

您的特定问题因动态脚本编译的实现而变得复杂,因此我们在编译期间不会看到错误,只有在运行时才会看到。

同样,如果这是您的代码,您应该捕获异常并处理它,您可能会更深入地了解根本原因。

您是否已阅读有关 SO 的这些帖子?:

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?
Java在半透明框架/面板/组件上重新绘画。
Java“ Class.forName()”和“ Class.forName()。newInstance()”之间有什么区别?
在此环境中不提供编译器。也许是在JRE而不是JDK上运行?
Java用相同的方法在一个类中实现两个接口。哪种接口方法被覆盖?
Java 什么是Runtime.getRuntime()。totalMemory()和freeMemory()?
java.library.path中的java.lang.UnsatisfiedLinkError否*****。dll
JavaFX“位置是必需的。” 即使在同一包装中
Java 导入两个具有相同名称的类。怎么处理?
Java 是否应该在HttpServletResponse.getOutputStream()/。getWriter()上调用.close()?
Java RegEx元字符(。)和普通点?