Visual Studio 2017 right-click project clean (Clean), build (Build) and rebuild (Rebuild)

  Quick summary, please read the official literature if the description is not complete!

  The senior author accidentally stepped on a pit in Visual Studio that we seldom use today - accidentally clicked on the project -> right click -> clean up, so a bunch of completely impossible errors appeared in the project. Out of curiosity, the author flipped through the relevant documents and briefly understood some of the simple differences between Clean (cleaning), Build (generation) and Rebuild (regeneration).

&nsbp; First:

  • Clean : Cleans all intermediate files and output directories.

  • Intermediate files (some files generated in the process of generating applications, generally dll files and exe files in the Debug/Release or x64/x86 directory under our project, etc. If you want to see, you can view the xxx. The value of the OutPut element in the csproj file, as shown in the figure:)

  • View output directory example

  • Build : Build the solution using the specified solution configuration file. This is easier to understand, that is, to generate intermediate files in the output directory (note the difference between it and regeneration)

  • Rebuild : Clean and then build the specified solution configuration.

  • The difference between Build and Rebuild: take an official explanation↓

  1. Select Build ProjectName to generate those item elements that were changed by the most recent build.

  2. Select Rebuild ProjectName to "clean" the project and then generate the project file and all project elements.

  As mentioned in the mark: The difference between Build and Rebuild is that one builds focus on the most recently modified project elements, and the other focuses on all project elements in the project. Secondly, Build will not automatically clean, Rebuild will automatically execute Clean again.

   OK, here's a portal for the description of the official document that is not very direct:

   Build and clean projects and solutions in Visual Studio

PS: The high-scoring answers of dalao on the last two StackOverFlow:

Enter image description

Enter image description

OK, record this first!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324435469&siteId=291194637