Shared projects, recompile for ever ref, or just once? RRS feed

  • Question

  • Just a curious question, if I have a solution with 3 class libraries that refrence one shared project, does the shared project get recompiled each time, so a total of three times, or is it just compiled once and embedded into each other dll.
    Wednesday, January 16, 2019 7:02 PM


  • If you updated any source file of the shared project when building those class libraries, or initiated re-build on any of those class libraries, the shared project will be recompiled, and only be updated to the class library you're currently building.

    Unless custom post-build step is defined on the shared project to build all the 3 class libraries, only the class library that you're building will got updated shared project file(s).

    P.S.: If the binaries timestamp is newer than the source files, the binaries will not be recompiled when "build" is choosen, therefore it won't enter infinate build loop with this setup unless the shared project uses some kind of source file generator that will regenerate the source file regardless of whether the relevent settings/metadata file is changed (say, some kind of POCO object builder that does not check for file change and blindly delete existing source file and emit new source file).

    • Edited by cheong00Editor Thursday, January 17, 2019 1:24 AM
    • Marked as answer by jmurphy9 Thursday, January 17, 2019 4:05 AM
    Thursday, January 17, 2019 1:19 AM