Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2017 Hangs when changing build configuration

I can change the build configuration from debug to release (or other debug configurations that I created), but when I change back to debug, Visual Studio freezes. Memory usage keeps climbing and climbing, until Visual Studio restarts by itself after an hour or so.

I'm sure that's going to get fixed at some point. As a temporary work-around, I was hoping to change which configuration is selected on startup by changing .suo file. However, that appears to be a binary file, and I see no easy way to edit it. Other than deleting the .suo file, is there another way to either select which configuration is selected on startup? Or suggestions to avoid the hanging? I have tried lightweight solution loading, and it made no difference.

I deleted the .suo file, and, as expected, a new one was recreated. The new .suo is 6kb big. The old .suo file is 13MB big.

like image 928
Jimmy Avatar asked Apr 24 '17 17:04

Jimmy


2 Answers

After deleting the big .suo file I was able to switch back and forth between build configurations. The .suo file is hidden in

C:\dev\[solution name]\.vs\[solution name]\v15\.suo 

(that's right, there is no filename, just a .suo extension)

like image 200
Jimmy Avatar answered Nov 10 '22 20:11

Jimmy


This is an old question but I found one solution that folks can use. All we need to do is:

  • open .sln file with a text editor
  • search for debug or release
  • under GlobalSection(SolutionConfigurationPlatforms) = preSolution, cut the build that you don't want. For eg. To remove debug, cut Debug|x86 = Debug|x86
  • save it
  • open the solution, you can see the build version has been changed to Release. Now close the solution and paste that line we cut, save it. If we open the solution again, we see that VS has retained the Release in build configuration.
like image 1
Bruce Wayne Avatar answered Nov 10 '22 21:11

Bruce Wayne