Skip to content

ProjectDependenciesCommandFactory.Create does not respect Configuration #5754

@NTaylorMullen

Description

@NTaylorMullen

Steps to reproduce

  • Instantiate a ProjectDependenciesCommandFactory with a specific configuration:
var commandFactory = new ProjectDependenciesCommandFactory(
    framework,
    "Release",
    outputPath: null,
    buildBasePath: null,
    projectDirectory: "....");
  • Create and execute ICommand: commandFactory.Create("some name", Enumerable.Empty<string>()).Execute()

Expected behavior

  • Executes command in the "Release" configuration.

Actual behavior

  • Executes command in the "Debug" configuration.

Why

Looks like if the configuration is not provided to the command factories Create method defaults to Constants.DefaultConfiguration instead of inheriting the ProjectDependenciesCommandFactory_configuration` private variable. See here.

Seems like an inconsistency amongst the other provided params like framework where it'll default to the ProjectDependenciesCommandFactory private variable value if it's not provided to Create.

Can currently work around this by providing the configuration to the ProjectDependenciesCommandFactory ctor and its Create method. (Or just the Create method, haven't fiddled with it too much to see if it's absolutely required to be set as a private variable).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions