Visual Studio’s Rebuild vs. Build

Build of course, like most tools, only compiles files that have changed since the last time a compilation was performed.

Rebuild of course, like most tools, re-compiles all source files regardless of whether they have changed since the last successful compile or not.

Simple right?  Not exactly….there are some subtle undocumented differences.  If a configuration file such as an appsettings.json file exists in your project, it is normally meant to be copied to your output folder for use by the application when you run it.  If you update this file, and Build or run the project VS.NET does not update the file in the output folder.  This has bewildered me on more than one occasion.  Only when you perform a Rebuild on that project (or solution) does the newer file get copied to the output folder.

Some intellisense errors in the IDE code editor involving code from other assemblies are also only resolvable by performing a rebuild.  I don’t recall the specific circumstances, but suffice to say, when in doubt perform a Rebuild.

Leave a Reply