I'm working on a simple command line project. I changed the properties from .NET 3.5 to .NET 4.0 and restarted Visual Studio 2010. I get this error:
The type initializer for '<Module>' threw an exception.
and Visual Studio does not start.
I have tried starting with devenv.exe /SafeMode
and devenv.exe /reset
, which make no difference. Google is not helping me either.
Help!
EDIT: I still can't get Visual Studio to do anything. I tried installing SharpDevelop, but that also fails to start, but with a more informative error:
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
I don't have .NET 4 at the path in the above error, I have a different version so it is installed at C:\Windows\Microsoft.NET\Framework\v4.0.30319
I have tried uninstalling .NET 4 and re-installing it, but it doesn't make either VS or #develop work, nor does it change the installation path.