Common Language Runtime detected an invalid program.
This issue was addressed in a previous (locked) thread, but the solution given does not work for me. I downloaded the trial today and got a few good runs in, but after making a few changes to the code, I now receive the "System.InvalidProgramException: Common Language Runtime detected an invalid program." error when running.
Here are the pertinent details:
- Running with ANTS Profiler Version 2.5.0, Build 492
- This error only occurs when running with a Debug build. I have ensured that the Release and Debug builds are synced.
- Both Debug and Release versions run fine when the profiler is not running.
- I was able to run the profiler on a Debug build after first downloading the trial. I identified a bottleneck and made a few small changes to the code. It was only after running my next test that the error appears. The changes I made were pretty small so I can't see how the code changes themselves would be causing this problem.
- The C# executable relies on two DLLs, one written in Managed C++ and the other unmanaged C++
- The failure always occurs in the same function in the Managed C++ DLL. Nothing stands out in this function as something that would cause this sort of exception to be thrown. This function exists about 8 functions deep on the call stack and is called as part of a button click event handler.
- Rebuilding the solution does not seem to help. Neither does rebooting.
- .NET CF Version: 1.1.4322.2032, Visual Studio.NET 2003
Please let me know if you have any suggestions as to how I can narrow the problem down. Thanks.