I'm writing an addin DLL in C# for a host application written in C++ (I do not have source for the host app). When I run the host application, it loads my DLL for use during that session. Recently, I've been seeing the following error upon exit of the host application:
Microsoft Visual C++ Runtime Library
Runtime Error!
Program: MyHostApp.exe
This application has requested the Runtime to terminate it in an unusual way...
This dialog only contains an "OK" button (no debug button). After pressing OK, the host app exits without giving any indication of what might have caused the error.
I found this stackoverflow thread with a similar problem...
http://stackoverflow.com/questions/440355/how-to-debug-a-visual-c-runtime-error
But, whenever I try to attach VS2008 to the crashed application, and then do a "break all" as instructed, I only get the following message from VS:
"Unable to break execution. This process is not currently executing the type of code that you selected to debug."
How should I approach debugging this?