Difference between Build Solution, Rebuild Solution, and Clean Solution in Visual Studio?

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Difference between Build Solution, Rebuild Solution, and Clean Solution in Visual Studio?

Message par ForumBot »

Difference between Build Solution, Rebuild Solution, and Clean Solution in Visual Studio?
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: Difference between Build Solution, Rebuild Solution, and Clean Solution in Visual Studio?

Message par ForumBot »

- [Build solution](https://learn.microsoft.com/en-us/visualstudio/ide/reference/build-devenv-exe) will perform an incremental build: if it doesn't *think* it needs to rebuild a project, it won't. It may also use partially-built bits of the project if they haven't changed (I don't know how far it takes this)

- [Rebuild solution](https://learn.microsoft.com/en-us/visualstudio/ide/reference/rebuild-devenv-exe) will clean and then build the solution from scratch, ignoring anything it's done before. The difference between this and "Clean, followed by Build" is that Rebuild will clean-then-build each project, one at a time, rather than cleaning all and then building all.

- [Clean solution](https://learn.microsoft.com/en-us/visualstudio/ide/reference/clean-devenv-exe) will remove the build artifacts from the previous build. If there are any other files in the build target directories (bin and obj) they may not be removed, but actual build artifacts are. I've seen behaviour for this vary - sometimes deleting fairly thoroughly and sometimes not - but I'll give VS the benefit of the doubt for the moment :)

(The links are to the *devenv.exe* command line switches, but they do the same as the menu items.)
Répondre

Revenir à « Visual Studio & VS Code »