如何配置VS编译只改变代码 [英] How to configure VS to compile only changed code
问题描述
我有非常大的解决方案,它每次编译我特林调试。结果
时间,所以我知道我可以禁用所有的解决方案配置的所有项目建设,但有办法要说到Visual Studion只编译改变代码?结果
我知道那是。
I have very big solution, and it compiling every time I'm tring to debug.
So I know that I can to disable building of all projects at all in solution configuration, but is there way to say to Visual Studion to compile only changed code?
I sure that is.
感谢您提前。
推荐答案
由于马尼克斯和安东已经说这是VS一般不会。但是,如果你有很多依赖于对方的解决方案中的项目,您将被所有人使用或同样最有还建别人的其他项目来进行更改组件确保一切按预期工作
As Marnix and Anton already said this is what VS normally does. But if you have a lot of projects within your solution which depend on each other and you make changes to a component which will be used by all or most of the other projects it has to built also the others again to make sure everything works as expected.
所以,如果它开始,如果你没有做,我们需要任何改变,甚至重新编译找出VS如何试图找出它需要在建立了增量做的。
So if it starts to recompile even if you didn't make any change we need to find out how VS tries to find out what it needs to do on a incremental built.
有关这一点,只是简单地检查每个文件的日期时间,如果有任何改变。如果是的话,重新编译文件及其所有相关性(在stdafx.h中如改变将导致一个完整的重建,导致通常每个源文件将引用到这一个)。
For this it simply checks the datetimes of every file and if there are any changes. If yes, recompile that file and all its dependencies (e.g. changes in a stdafx.h will result in a complete rebuilt, cause normally every source file will reference to this one).
不过也有例外的行为。例如安装项目将始终重建,即使没有做(由于这个事实,我通常排除在建过程中的安装项目,并只在需要时手动启动它)的变化。
But there are also exceptions to this behaviour. A setup project for example will always rebuilt, even if there are no changes made (due to this fact i normally exclude the setup project from the built process and start it only manually when needed).
所以,如果你只有C / C ++,C#,VB等项目通常支持增量竣工图必须有东西两个竣工图上是不同的,即使你不改变任何事情。
So if you only have C/C++, C#, VB etc. project which normally support incremental builts there must be something that changes between two builts, even if you don't change anything.
下面是一些可能性:
- 系统前或后建命令进行了更改源文件
- 这也许可以从你的回购添加修订版本号的AssemblyInfo文件的资源的自动更新。
- 或副本/ delete命令,使您的目录结构进行一些改变(我用这一个时间删除输出目录的预建命令强制在重建的每一个建)。
- 的自动增量可能通过使用
[装配:1.0 *的AssemblyVersion( )]
或其他一些外部进程,以增加内置数
- maybe by using
[assembly: AssemblyVersion("1.0.*")]
or some other external process to increase the built number
如果上述步骤之一发生在一个模块从全部或大部分的其他项目的依赖于一切需要重建。
If one of the above steps happens to a module from which all or most of your other projects depends on than everything needs to be rebuilt.
这篇关于如何配置VS编译只改变代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!