We are seeing this “Common language runtime Exception in an Invalid Program” error when we use release mode dll in unit tests . AutoTest are Passing when we use Debug mode dll
We observed that Optimize setting (true) was true in release mode dll, As per Microsoft suggestion we tried building dll (without changing the Framework Version) in older versions i.e, the with VS2013, ATs are Getting Passed. May be VS2022 is doing Heavy optimization for this dll.
So we need to know What was differences done by Microsoft for Optimize setting in VS2013 (Older version) and newer Version of VS2022 ? Can you help us to resolve this issue. Can we have any workaround for it quickly ? Because we are seeing this issue only in VS22 compiler.
Need a solution or workaround for this