Skip to content

Enlighten ResolveKeySource task for multithreaded mode #13620

@jankratochvilcz

Description

@jankratochvilcz

Enlighten ResolveKeySource task for multithreaded mode

Parent: #11834

Context

ResolveKeySource uses File.OpenRead(KeyFile) to read PFX key files. The KeyFile path could be relative, resolving against Environment.CurrentDirectory under multithreaded execution.

Sin 1 risk: ResolvedKeyFile = KeyFile assigns the input path directly to an [Output] property. After absolutization, we must use the original path for the output to avoid contamination.

Approach

  1. Mark ResolveKeySource with [MSBuildMultiThreadableTask] and implement IMultiThreadableTask
  2. Absolutize KeyFile via TaskEnvironment.GetAbsolutePath() before File.OpenRead()
  3. Preserve original KeyFile string for ResolvedKeyFile output property (Sin 1)
  4. Use OriginalValue in error messages (Sin 2)

Acceptance criteria

  • ResolveKeySource decorated [MSBuildMultiThreadableTask] and implements IMultiThreadableTask
  • KeyFile absolutized before File.OpenRead()
  • [Output] ResolvedKeyFile preserves original path string (Sin 1)
  • Error messages use original paths (Sin 2)
  • All existing tests pass
  • No new compiler warnings

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: MultithreadedArea: TasksIssues impacting the tasks shipped in Microsoft.Build.Tasks.Core.dll.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions