
This is the problem that I have seen, which happens, when you mix managed (.NET) and unamanaged code C++ and try to run this in Debug mode in Windows Server 2008. I get this popup shown above and the release version just runs fine without any issues. This popup comes even before Visual Studio tries to run the process in the debugger. You cannot do maanged mode debugging anyway in X64, but you can still debug just managed code, even if it references unamanged. Well, then I tried to run the process in WinDbg, it crashed as well and the Stack Trace complained about dynamic intializer for a particular type global string declared static in native C++, which was referenced by Managed C++ code. Then, I started a web search and found this interesting article by Danny Kalev (Thanks Danny!) http://www.informit.com/blogs/blog.aspx?uk=30-C-Tips-in-30-Days-Tip-25-overcoming-static-initialization-dependencies When I implemented the static variables as mentioned in the blog the problem went away. Then , a very smart colleague suggested to try #define for string and that also worked. Interesting , this problem complained only about the string. There are global static int variables that this binary has, but it never complained about it. I don't know why? It also complianed about const std::string defined globally.