简体   繁体   中英

C# & VS2015: How to save time when compiling?

So, I have a BIG project with lots of stuff in it, but when for example I fix the code, VS2015 compiles the whole project again which takes lots and lots of time. Can I somehow only compile the file I edited?
EDIT: I have one solution, in that I have one project, in that project I have lots of files.

The Build process is smart, it will skip projects that haven't changed and for which the dependencies also haven't been changed. If you change something inside a library that is used by more or less the entire solution, then there just is no alternative but to rebuild all that was (potentially) touched.

You could try tuning the Dependencies yourself, right-click on the Solution and select 'Project dependencies...'. But you can't remove Dependencies that are needed or inferred.

Get an SSD as build drive. A fast one.

All the other tips given here are a given - build is smart, so it will only recompile what needs to be recompiled. This is hardly a help, though, if you have a base library that triggers dozens of projects to update.

Compilation is IO limited, so a SSD helps

Otherwise it may be time to destroy that large solution and generate inernal NUGET packages of base libraries. This can decouple recompilations of base libraries and actual applications. This is particularly useful if you do maintenance on the base libraries.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM