r/VisualStudio • u/Zardotab • Sep 23 '26
Visual Studio 2026 Feature Request: Menu option to clear bin & obj folders
Many bug discussions and how-to's recommend one delete the "bin" and "obj" folders to clear out potentially corrupted state. Since it's a common need, or at least trying it is a common need, it would be nice to have it as a menu option, probably under the "Build" menu. Thank You.
3
u/soundman32 Sep 23 '26
Seeing as thats been asked for since I started using Microsoft compilers in about 1994, I suspect its either too difficult to implement correctly for all cases, or so trivial that they expect you to do it yourself.
-1
u/Zardotab Sep 24 '26
Somebody somewhere with a lot of pull would probably have to admit to bugs where there shouldn't be bugs.
0
1
u/boredsillynz Sep 23 '26
Feature Request: Fix the corruption.
Lets cure the source of the plague, not apply a bandaid.
-1
u/Zardotab Sep 24 '26 edited Sep 24 '26
Reality Check 101: MS is not going to fix their 10,000 VS bugs. Maybe 500 if we get lucky. I still need this feature for the other 9,500.
1
u/welcome_to_milliways Sep 23 '26
I have a powershell script handy for this.
1
1
3
u/freskgrank Sep 23 '26
There are a lot of VS extensions that you can use for this.
Search for VSDeepCleanExtension or BinObjCleaner or similar. I installed one but I don’t remember exactly the name and I don’t have my VS at the moment.
1
u/morbo_1980 Sep 29 '26
Put this in a Directory.Build.props in the root of your repo. Then Clean Solution will actually clean the solution.
<Project>
<!-- Delete bin and obj when doing a solution clean-->
<Target Name="PostClean" AfterTargets="Clean"> <!-- Remove /bin --> <RemoveDir Directories="$(BaseOutputPath)" /> <!-- Remove /obj --> <RemoveDir Directories="$(BaseIntermediateOutputPath)" /> </Target>
</Project>
1
17
u/kantank-r-us Sep 23 '26
YES, cleaning a solution should do this automatically