-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Issue-Code Cleanupthe issue is for cleaning up the code with no impact on functionalitythe issue is for cleaning up the code with no impact on functionalityNeeds-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.Resolution-FixedThe issue is fixed.The issue is fixed.WG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
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:
PowerShell/src/System.Management.Automation/engine/ExecutionContext.cs
Lines 222 to 233 in 4aaed08
| 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 @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
Metadata
Metadata
Assignees
Labels
Issue-Code Cleanupthe issue is for cleaning up the code with no impact on functionalitythe issue is for cleaning up the code with no impact on functionalityNeeds-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.Resolution-FixedThe issue is fixed.The issue is fixed.WG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime