Skip to content

[Question]Does msbuild reuse process node? #4954

Description

@MarcoRossignoli

Simple question to be sure...does msbuild reuse process host during build right(for instance on a solution with a lot of projects)?
I mean if I've got a task with static data it's possible that different builds reuse same process(app domain) and my statics are previous value?
related issue #2916
I need only an "I confirm"

Activity

  1. rainersigwald commented on Dec 4, 2019

    @rainersigwald
    Member

    I need only an "I confirm"

    If only it were that simple! :)

    MSBuild always reuses processes within a build, so your example of "a solution with a lot of projects" will always have a finite set of processes. The processes will last at least until the end of the build in all cases.

    If node reuse is enabled (it is enabled by default), worker nodes will outlive the build that created them, and may be reused for subsequent builds. There is no guarantee that the subsequent build is of the same or similar projects, and there is no guarantee that a subsequent build of the same projects will assign a particular project to the same node it used before.

    It is also possible to define a task that gets its own AppDomain, which complicates the statics situation.

  2. added this to the Discussion milestone on Dec 4, 2019
  3. MarcoRossignoli commented on Dec 4, 2019

    @MarcoRossignoli
    MemberAuthor

    There is no guarantee that the subsequent build is of the same or similar projects

    But same solution?Or are shared "user session wide"?

  4. rainersigwald commented on Dec 4, 2019

    @rainersigwald
    Member

    Nodes are reusable by the same user for their lifetime.

    No guarantee that it's the same solution; a user could have two repos open in different command lines and build one, then the other.

  5. MarcoRossignoli commented on Dec 4, 2019

    @MarcoRossignoli
    MemberAuthor

    Ok thanks a lot for the clarification!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions