开发者

What is the difference between a "build" and a "rebuild" in Visual Studio?

开发者 https://www.devze.com 2023-01-29 20:48 出处:网络
I do not know if i understood 开发者_如何学Goright , the difference between a \"build\" and \"rebuild\" command of a project in Visual Studio is the fact that a build only compiles the code which was

I do not know if i understood 开发者_如何学Goright , the difference between a "build" and "rebuild" command of a project in Visual Studio is the fact that a build only compiles the code which was changed , since a "rebuild" command compiles all the code from project regardless is it was changed or not.

Also a rebuild command includes a clean of the project, since build command does not ?

Please advice me to understand better these differences.

Thanks !


Also a rebuild command includes a clean of the project, since build command does not ?

You have identified the fundamental difference.

Build will look at the files that have been modified since the last successful compile and link and just compile those and then link the result.

Rebuild will recompile everything.

Strictly speaking it might be different to a clean (which removes the intermediate and output files) and build and just recompile everything, but the result should be the same. However, there may be cases that fail (see Femaref's comment).


Build means to compile all the code that was altered or written after the last compilation.

Rebuild means to compile the whole project regardless of whether or not the code was changed.

So, after making you read my answer, yes you would be correct.


As far as I experience, if your dlls/exes are needed to be copied via post build and the location to where the files are copied is locked or otherwise due to another problem, somehow the files are not able to be copied but the compilation is done without any issue, you need to rebuild in this case.

0

精彩评论

暂无评论...
验证码 换一张
取 消