Visual Studio freezes when switching to debug mode

后端 未结 4 1350
面向向阳花
面向向阳花 2021-02-05 05:09

Strange Visual Studio (TS 2008) problem: The IDE completely freezes whenever I switch from Release to Debug mode in a specific project. It happens right as I switch, before I tr

相关标签:
4条回答
  • 2021-02-05 05:24

    If everything has worked fine and then stopped, usually it means there was some problem even though it had passed unnoticed.

    Things I would try one after another:

    1. Check which files were changed (why and how) after update from a source control engine
    2. Review the list of extensions and plugins. Try to disable all or some of them
    3. Close Visual Studio and kill all the development processes: devenv, mspdbsrv, vcpkgsrv, msbuild, msvsmon, vshub, vstest etc
    4. Remove .suo, .ncb, .VC.db, .VC.VC.opendb files of the solution as well as .vs directory, which sometimes cause problems
    5. Remove project setting files, sort of YourProjectName.vcproj.DOMAINNAME.LOGINNAME.user or YourProjectName.csproj.user. The setting file name depends on a project kind you use
    6. Run "C:\Program Files\Microsoft Visual Studio [vs_version]\Common7\IDE\devenv.exe" /setup or "C:\Program Files (x86)\Microsoft Visual Studio [vs_version]\Common7\IDE\devenv.exe" /setup for x64 environment
    7. In some complex cases, it helps to remove user settings, located in home %USERPROFILE%\AppData\[Local|Roaming]\Microsoft\VisualStudio[vs_version] and in registry HKCU\SOFTWARE\Microsoft\VisualStudio[vs_version]

    It should reset all things to the beginning state. If it won't work, so there are additional tools to investigate. Download Process Explorer and once IDE freezes, start the Process Explorer, find the devenv process, double-click on it and go to Threads tab. Check, which thread has the biggest switch delta in case of the freeze, double-click on it and take the name (or offset) of the top function. It gives additional info where the problem may be.

    Moreover, sometimes it helps to repair Visual Studio in the "Add or Remove Programs" wizard in Control Panel.

    0 讨论(0)
  • 2021-02-05 05:31

    I've encountered this in VS 2017 (15.8). Upgrade to the newest version (15.9 at that time) resolved the issue.

    0 讨论(0)
  • 2021-02-05 05:38

    Had this problem in 2017. I ran VS 2017 as Administrator and it worked.

    0 讨论(0)
  • 2021-02-05 05:39

    VS seems to be doing a lot behind the scenes and putting project-specific files in App Data and who knows where else. I had this experience: I had a project which had two sets of identical code in two different directories: one for production, one for development. The development project started hanging on debug, the production did not. Tried all kind of settings and deleting .suo files, but no help. So I renamed the directory that the development version was in and presto, eveything worked without hanging.

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