visual-studio - Visual Studio 2010 启动 : "type initializer for ' <Module >' threw an exception."

标签 visual-studio visual-studio-2010

我正在做一个简单的命令行项目。我将属性从 .NET 3.5 更改为 .NET 4.0 并重新启动 Visual Studio 2010。我收到此错误:

The type initializer for '<Module>' threw an exception.



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/

相关文章:

c# - editorconfig - 如何为只读私有(private)字段指定下划线前缀?

sql-server - Visual Studio Azure SQL Server : no connection could be made because the target machine actively refused it

c# - 保持VS2005与文件系统同步?

c++ - fatal error LNK1104 : cannot open file 'libboost_system-vc90-mt-gd-1_43.lib'

c++ - max和fmax的区别(跨平台编译)

visual-studio - Visual Studio 2010 Premium 和 Windows 7 移动开发

visual-studio-2010 - VS2010中引用前面的红色感叹号图标是什么意思?

asp.net - 当您需要共享规则时,如何管理同一解决方案中不同项目中的 web.config 文件?

c# - 现有的 DI 框架使用和 Silverlight

visual-studio - NUnit 中的跟踪仅在从 Visual Studio 进行调试时有效