我正在做一个简单的命令行项目。我将属性从 .NET 3.5 更改为 .NET 4.0 并重新启动 Visual Studio 2010。我收到此错误:
The type initializer for '<Module>' threw an exception.
并且 Visual Studio 没有启动。
我试过从
devenv.exe /SafeMode
开始和 devenv.exe /reset
,这没什么区别。谷歌也没有帮助我。帮助!
编辑:我仍然无法让 Visual Studio 做任何事情。我尝试安装 SharpDevelop,但也无法启动,但出现了更多信息错误:
Unhandled exception terminated SharpDevelop Exception thrown: System.TypeInitializationException: The type initializer for 'ICSharpCode.Core.Presentation.MenuService' threw an exception. ---> System.TypeInitializationException: The type initializer for '<Module>' threw an exception. ---> <CrtImplementationDetails>.ModuleLoadException: The C++ module failed to load during appdomain initialization. ---> System.DllNotFoundException: C:\Windows\Microsoft.NET\Framework\v4.0.21006\WPF\wpfgfx_v0400.dll ---> System.ComponentModel.Win32Exception: The specified module could not be found
我在上述错误的路径中没有 .NET 4,我有一个不同的版本,所以它安装在
C:\Windows\Microsoft.NET\Framework\v4.0.30319
我曾尝试卸载 .NET 4 并重新安装它,但它不会使 VS 或 #develop 工作,也不会更改安装路径。
最佳答案
如果 Visual Studio 无法启动,则很可能是在启动期间加载的第 3 方组件导致了此问题。根除它的最佳方法是尽可能卸载扩展。如果不试试
devenv /resetSettings
之后,下一步是尝试修复安装。
关于visual-studio - Visual Studio 2010 启动 : "type initializer for ' <Module >' threw an exception.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5980847/