Skip to content

Migrate UnregisterAssembly to multithreaded execution #13634

@jankratochvilcz

Description

@jankratochvilcz

Background

UnregisterAssembly reverses RegisterAssembly by unregistering managed assemblies and their type libraries from COM. Like its counterpart, it is AppDomainIsolatedTaskExtension, gated on NETFRAMEWORK && FEATURE_APPDOMAIN.

Migration scope

  • Apply [MSBuildMultiThreadableTask] (defensive)
  • Implement IMultiThreadableTask only if reachable from a multithreaded host
  • Absolutize paths via TaskEnvironment.GetAbsolutePath() for: Assemblies items, TypeLibFiles items, AssemblyListFile
  • Use TaskEnvironment.GetEnvironmentVariable() for: N/A
  • Use TaskEnvironment.GetProcessStartInfo() for: N/A

Known complexity factors

  • AppDomain isolation; TaskEnvironment must cross the AppDomain boundary
  • Native COM unregistration; mutates registry (TYPE_E_REGISTRYACCESS handling)
  • NETFRAMEWORK-only — multithreaded mode unlikely to ever exercise this code
  • Globally serialized in practice due to registry mutation

Exit criteria

  • Build clean, no new warnings
  • Existing tests pass
  • No regression in error message paths (Sin 2 audit)
  • No leakage of absolutized paths into [Output] properties (Sin 1 audit)

References

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

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions