Unittest is throwing "Common language runtime Exception in an Invalid Program" using 4.8 Target Framework and 17.6.4 Visual Studio

TejaSai-Varma Borukati 0 Reputation points


I had Created one unit test and added some dll references to it. my unit test calls one of the method of my referred dll, At some point I was getting "Common language runtime Exception in an Invalid Program" Exception. This Was occurring when we referred dll which built with release mode, if We refer dll built with debug mode - we are not seeing this issue. This might because of Optimize setting in project, if we made optimize to false in release mode, issue is not reproduced.

We are not seen this when we are using 4.6.1 Framework. After updating to framework 4.8 , we are getting this issue

Please Provide some helpful Information for above issue?


Teja Sai Varma.

A set of technologies in the .NET Framework for building web applications and XML web services.
4,134 questions
{count} votes