简体   繁体   中英

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

I had one source code having 25 projects in single solution. It is consisting of both c++ as well as C# project. But now i wanted to call one of C# project(which is of windows application type) calls from a separate test project. I created a separate c# project and added the source reference, and created a object of source code class. it is building fine. but at the time of execution, it is throwing:

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

Please give me suggestion to resolve this issue.

I got this execption and when I looked at the stack trace, it had another exeception: Arthimetic operation resulted in overflow. In my case, the application I was trying to run, required 32-bit mode where as the IIS in my Windows 8 machine runs in 64-bit mode by default. I had to set Enable 32-bit Applications to true for the AppPool this application was using.

The type initializer for '<Module>' threw an exception and Arithmetic operation resulted in an overflow

Experienced a similar problem when catching the error with a try-catch... Upon removing the try-catch block the full trace indicated FIPS as the culprit. Toggling the registry switch to 0 for FIPS solved the problem in this case.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM