Visual Studio 2010 Crashing on Solution Load

后端 未结 7 1878
萌比男神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:52

    Set the form that crashes Visual Studio as the main form to load. Then start the form in debug mod from the DEBUG menu.

    0 讨论(0)
  • 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.

    0 讨论(0)
  • I encountered a similar problem, VS2010 crashed upon loading a specific solution. It turned out to be an incomplete line in the code that caused VS2010 to run amok. When I commented the line out, everything was ok.

    The line in question was:

    getCommonResourcesDirectory([out, retval] BSTR* );
    
    0 讨论(0)
  • 2021-02-20 06:58

    I tried the following in the order i performed:

    1. devenv.exe /resetsettings , devenv.exe /resetskippkgs (did not work)

    2. devenv.exe /safemode (told me that product version cannot open .ccproj types. But no counter solution worked)

    3. renamed the .user, .suo files (did not work)

    4. Installed any and every service pack for VS2010 even if they were remotely related to C# development.

    5. "Reinstalled" VS2010 using the 'repair/reinstall' option(did not work)

    6. Uninstalled VS2010 and then installed (this was my solution even though many of them tried this and failed. Might be because this was my last resort.)

    0 讨论(0)
  • 2021-02-20 07:01

    If it's a C++ project, try deleting any PDB files that are hanging around - these sometimes get corrupted and cause crashes.

    0 讨论(0)
  • 2021-02-20 07:01

    I realize this is an old post, but I came up with another solution today as I was working on the same issue. In my case, VS was trying to open a source code file using the CSharp Form Editor instead of the CSharp Editor.

    When that happened, the code started to run (I saw my splash screen) but an error occurred (I saw my error message about not finding some hardware) and the resulting error closed VS. Trying to reopen the project would have VS open the *.cs file again, creating a frustrating loop of crashes.

    I was able to open the project after deleting the *.suo file. Then in Solution Explorer I right clicked the code file and selected Open With. In the dialog I changed the default and everything was fine, including seeing the hardware that I was not finding before.

    0 讨论(0)
提交回复
热议问题