Difference between Build Solution, Rebuild Solutio

2019-01-02 19:19发布

What is the difference between Build Solution, Rebuild Solution, and Clean Solution in Visual Studio?

When is the appropriate time to use each one of these?

12条回答
皆成旧梦
2楼-- · 2019-01-02 19:38

Build solution only builds those projects which have changed in the solution, and does not effect assemblies that have not changed,

ReBuild first cleans, all the assemblies from the solution and then builds entire solution regardless of changes done.

Clean, simply cleans the solution.

查看更多
裙下三千臣
3楼-- · 2019-01-02 19:40

Build Solution - Build solution will build your application with building the number of projects which are having any file change. And it does not clear any existing binary files and just replacing updated assemblies in bin or obj folder.

Rebuild Solution - Rebuild solution will build your entire application with building all the projects are available in your solution with cleaning them. Before building it clears all the binary files from bin and obj folder.

Clean Solution - Clean solution is just clears all the binary files from bin and obj folder.

查看更多
栀子花@的思念
4楼-- · 2019-01-02 19:44

Build solution

This will perform an incremental build. In other words it will only build code files which have changed. If they have not changed those files will not be touched.

Rebuild solution

This will delete all currently compiled files (i.e., exe and DLLs) and will build everything from scratch, irrespective of if there is code change in the file or not.

Clean solution menu

This menu will delete all compiled files (i.e., EXE’s and DLL’s) from the bin/obj directory.

Rebuild = Clean + Build

查看更多
高级女魔头
5楼-- · 2019-01-02 19:45

Build Solution - Builds any assemblies which have changed files. If an assembly has no changes, it won't be re-built. Also will not delete any intermediate files.

Used most commonly.

Rebuild Solution - Rebuilds all assemblies regardless of changes but leaves intermediate files.

Used when you notice that Visual Studio didn't incorporate your changes in the latest assembly. Sometimes Visual Studio does make mistakes.

Clean Solution - Delete all intermediate files and rebuild all assemblies regardless of changes

Used when all else fails and you need to clean everything up and start fresh.

查看更多
情到深处是孤独
6楼-- · 2019-01-02 19:47

Build solution will build any projects in the solution that have changed. Rebuild builds all projects no matter what, clean solution removes all temporary files ensuring that the next build is complete.

查看更多
骚的不知所云
7楼-- · 2019-01-02 19:49

I just think of Rebuild as performing the Clean first followed by the Build. Perhaps I am wrong ... comments?

查看更多
登录 后发表回答