Calling C++ dll from .Net Code is Excruciatingly Slow when a Debugger is Attached
问题 I am using VS 2008 to compile and debug my code. In my application, the front end is C#, the backend is C++. I access the C++ code via interop. One thing I notice is that if I press F5, and I link in the debug version of the native code, it would take more than 20 seconds to run the native code. If I link in the release version of the native code, the time needed to run it is cut down to 7-8 seconds. And if I don't have the VS 2008 debugger attached ( i.e., I click on the exe outside of the