Visual Studio中的“构建"和“重建"之间的主要区别是什么? [英] What is the main difference between the Buid and Rebuild in VisualStudio?

查看:136
本文介绍了Visual Studio中的“构建"和“重建"之间的主要区别是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在一个项目中工作,因为当我构建项目时,dll文件正在创建/修改,但是dll创建的日期没有改变.但是,当我重新生成项目时,dll文件将使用当前日期重新创建.

因此,在Visual Studio中构建项目和重建项目之间的主要区别是什么.

此致
Srinubabu.

Hi,

I am working in one project in that when i build the project the dll file is creating/modifying but dll created date is not changing. But when i Re-Build my project the dll file is newly creating with the current date .

So, What is the main difference between building the project and rebuilding the project in visual studio.

Regards,
Srinubabu.

推荐答案

Build 表示仅编译和链接自上次构建以来已更改的源文件.
重建意味着编译和链接所有源文件,无论它们是否更改.

但是不能保证它们是相同的.这三个动作(rebuild, build, clean)代表不同的 MSBuild 目标.每个项目文件都可以覆盖其中的每个文件,以执行自定义操作.因此,某人完全有可能在启动clean + build(或完全删除它们)之前重写rebuild来执行多个操作.

构建是正常的事情,并且速度更快.有时项目目标组件的版本可能会不同步,因此必须进行重建才能使构建成功.在实践中,您永远不需要清洁.
重建=清理+构建

构建或重建解决方案将生成或重建解决方案中的所有项目,而构建或重建解决方案< project name =">生成或重建StartUp项目.
(要设置启动项目,请在解决方案资源管理器"选项卡中右键单击所需的项目名称,然后选择设为启动项目.项目名称现在以粗体显示.).

当您请求构建​​/重建时,所有已更改的源文件都会被保存,因此您不必先保存它们.
当您运行可执行文件(F5或Ctrl-F5)时,Visual Studio会保存所有更改的源文件并生成任何更改的内容,因此您无需每次都明确地执行这些步骤.这样可以进行快速的尝试和错误"调试.
Build means compile and link only the source files that have changed since the last build.
Rebuild means compile and link all source files regardless of whether they changed or not.

But they are not guaranteed to be the same. The 3 actions (rebuild, build, clean) represent different MSBuild targets. Each of which can be overriden by any project file to do custom actions. So it is entirely possible for someone to override rebuild to do several actions before initiating a clean + build (or to remove them entirely).

Build is the normal thing to do and is faster. Sometimes the versions of project target components can get out of sync and rebuild is necessary to make the build successful. In practice, you never need to Clean.
Rebuild = Clean + Build

Build or Rebuild Solution builds or rebuilds all projects in the your solution, while Build or Rebuild <project name=""> builds or rebuilds the StartUp project.
(To set the StartUp project, right click on the desired project name in the Solution Explorer tab and select Set as StartUp project. The project name now appears in bold.)

All source files that have changed are saved when you request a build/rebuild, so you don''t have to save them first.
When you run your executable (F5 or Ctrl-F5), Visual Studio saves all your changed source files and builds anything that changed, so you don''t need to explicitly do those steps every time. This allows for quick "trial and error" debugging.


构建仅编译自上次构建以来已更改的文件.

重建将删除所有旧文件(执行清除操作),然后生成所有文件).

实质上是Rebuild = Clean + Build.
Build will only compile the files that have changed since the last time you did a build.

A rebuild removes all the old files (performs a clean) and then builds all the files).

In essence Rebuild = Clean + Build.


来自 http://www.cs.tufts.edu/r/graphics/resources/vs_getting_started/vs_getting_started.htm [
编译只是编译当前正在编辑的源文件.在其余源文件处于不完整状态时快速检查错误很有用,这会阻止整个项目的成功构建. Ctrl-F7是编译的快捷键.
From http://www.cs.tufts.edu/r/graphics/resources/vs_getting_started/vs_getting_started.htm[^], which I found with a Google search of build rebuild visual studio:

Build means compile and link only the source files that have changed since the last build, while Rebuild means compile and link all source files regardless of whether they changed or not. Build is the normal thing to do and is faster. Sometimes the versions of project target components can get out of sync and rebuild is necessary to make the build successful. In practice, you never need to Clean.

Build or Rebuild Solution builds or rebuilds all projects in the your solution, while Build or Rebuild <project name> builds or rebuilds the StartUp project, "hello" in the screen shot above. To set the StartUp project, right click on the desired project name in the Solution Explorer tab and select Set as StartUp project. The project name now appears in bold. Since the homework solutions typically have only one project, Build or Rebuild Solution is effectively the same as Build or Rebuild <project name>.

Compile just compiles the source file currently being edited. Useful to quickly check for errors when the rest of your source files are in an incomplete state that would prevent a successful build of the entire project. Ctrl-F7 is the shortcut key for Compile.


这篇关于Visual Studio中的“构建"和“重建"之间的主要区别是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆