Skip to content

AppDomain.Unload usage is deprecated and should be removed #15535

Closed

Description

As per, https://docs.microsoft.com/en-us/dotnet/fundamentals/syslib-diagnostics/syslib0024 the usage of AppDomain.Unload is deprecated and should be removed.

It is used at:

internal void ReleaseResponsibilityForModuleAnalysisAppDomain()
{
Diagnostics.Assert(_responsibilityForModuleAnalysisAppDomainOwned, "Invalid module analysis app domain state");
if (AppDomainForModuleAnalysis != null)
{
AppDomain.Unload(AppDomainForModuleAnalysis);
AppDomainForModuleAnalysis = null;
}
_responsibilityForModuleAnalysisAppDomainOwned = false;
}

As per discussion with Dongbo Wang (@daxian-dbw) the code is old and not used anymore and should be cleaned up.

Steps to reproduce

Compile code with .NET 6 preview 5 will throw a warning causing a build break: https://github.com/PowerShell/PowerShell/runs/2764430556?check_suite_focus=true#step:4:105

Activity

  1. added
    WG-Engine
    Needs-Triage
    Issue-Code Cleanup
    on Jun 7, 2021
  2. rjmholt commented on Jun 14, 2021

    @rjmholt
    Collaborator

    Fixed in #15554

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

    Issue-Code CleanupNeeds-TriageResolution-FixedWG-Engine

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions