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

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

  • Comments 2

Issue: when you try to launch visual studio throw command prompt you might run into the following error

 

Reason:

Because of conflict with the .Net versions the error is thrown.

Solution:

Clear the vairable complus_version or set the complus_Version to latest .NET version. In my case I changed from v.2.0.xxxx. to v4.0.30319. you can verify the latest .Net version from the folder  C:\Windows\Microsoft.NET\Framework

 

Leave a Comment
  • Please add 6 and 5 and type the answer here:
  • Post
  • can you tell us how to clear or set the complus_versio step by step

  • Answering boboka:

    How to set environment variables?

    using command prompt = set complus_versio="enterText"

    reference: http://ss64.com/nt/set.html

Page 1 of 1 (2 items)