我进行了广泛的谷歌搜索和调试,但是我无法弄清楚是什么导致了这个异常。有人说重新安装.NET框架有时可以解决问题,但作为一种解决方法似乎有些不可靠:
TypeInitializationException: The type initializer for '<Module>' threw an exception.
The C++ module failed to load during appdomain initialization.
The system cannot find the file specified
StackTrace:
at CModuleInitialize.LoadWpfGfx(CModuleInitialize* )
at CModuleInitialize.{ctor}(CModuleInitialize* )
at ?A0x828d0bb1.??__E?A0x828d0bb1@cmiStartupRunner@@YMXXZ()
at _initterm_m((fnptr)* pfbegin, (fnptr)* pfend)
at <CrtImplementationDetails>.LanguageSupport.InitializePerAppDomain(LanguageSupport* )
at <CrtImplementationDetails>.LanguageSupport._Initialize(LanguageSupport* )
at <CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport* )
有任何线索吗?
背景
这是一个WinForms应用程序,使用C#编写,并使用少量新的WPF组件编写。我们收到的崩溃报告除了我展示的(堆栈跟踪等)之外没有更多的上下文信息,而且我们没有做任何C++、托管或其他方面的工作。
我无法重现此崩溃,但远程诊断几个客户表明,重新安装.NET框架可能会为该客户解决此问题。
报告此崩溃的客户会多次报告,似乎他们在重新安装.NET框架或回退到仅使用.NET 2.0的旧版本应用程序之前都无法使用该应用程序。
链接
一些链接表明.NET Framework的测试版或Visual Studio与此崩溃可能有关,但在这种情况下似乎不太可能。
另一个可能的联系可能是与Visual C++ 2005可再发行组件有关。