Visual Studio 2010 Crashing on Solution Load

后端 未结 7 1966
萌比男神i
萌比男神i 2021-02-20 06:32

I\'ve seen a lot of similar questions, but I don\'t think I\'m duplicating. Here\'s my situation. I have three solutions that I\'m working with. A works fine, but when I try

7条回答
  •  误落风尘
    2021-02-20 06:54

    A crash can also happen in Visual Studio 2010 during solution load if/when the testing tools (Test View window etc.) load a DLL that throws an exception during initialization.

    My specific case was a C++/CLI test project where a global variable was throwing an exception during construction of it, that constructor being called during DLL INIT. (It was the std::tr1::regex class constructor throwing due to invalid pattern string passed to it.)

    This was quite a subtle problem because you don't expect your code to run until you execute the test; but in the case of ctors of C++ globals it is being run by the IDE immediately after build and on solution load.

    I suspect Visual Studio 2010 test manager component isn't wrapping the Dll load call in a try/catch block where it might.

提交回复
热议问题