Skip to content

PowerShell 7.2 and 7.4 bundle deprecated Microsoft.Bcl.AsyncInterfaces 5.0.0.0 #21324

@keithallenjackson

Description

@keithallenjackson

Prerequisites

Steps to reproduce

# PS 7.2
## CSharpModule is a PowerShell module written in C# targeting netstandard2.0 and dependent on package PowerShell.Standard.Library 5.1.1 and Microsoft.Bcl.AsyncInterfaces 6.0.0.0

PS> Import-Module /app/CSharpModule.dll
# PS 7.4
## CSharpModule is a PowerShell module written in C# targeting netstandard2.0 and dependent on packages PowerShell.Standard.Library 5.1.1 and Microsoft.Bcl.AsyncInterfaces 6.0.0.0 or 7.0.0.0 or 8.0.0.0

PS> Import-Module /app/CSharpModule.dll
# The PowerShell 7 install should also bundle the appropriate version of Microsoft.Bcl.AsyncInterfaces for its target framework
## PS 7.2 - .NET 6.0 - Microsoft.Bcl.AsyncInterfaces 6.0.0.0
## PS 7.4 - .NET 8.0 - Microsoft.Bcl.AsyncInterfaces 8.0.0.0
PS> $installDir = [System.IO.Path]::GetDirectoryName((Get-Command pwsh).Location)
PS> $bclLibraryPath = Join-Path $installDir "Microsoft.Bcl.Libarary.dll"
PS> Add-Type -Path $bclLibraryPath
PS> [System.AppDomain]::CurrentDomain.GetAssemblies() | Where { $_.FullName -like "*Microsoft.Bcl.AsyncInterfaces*" } | Select -ExpandProperty FullName

I have an example repository that does this these very steps including their results here

Expected behavior

## PS 7.2
- Nothing: Successful import

## PS 7.4
- Nothing: Success import

## Bundled Microsoft.Bcl.AsyncInterfaces
Should match the given target .NET version
PS 7.2 (.NET 6.0) -> 6.0.0.0
PS 7.4 (.NET 8.0) -> 8.0.0.0

Actual behavior

## PS 7.2
Failed import

## PS 7.4
Failed Import

## Bundled Microsoft.Bcl.AsyncInterfaces
Microsoft.Bcl.AsyncInterfaces, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51

Error details

## PS 7.2
Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. Could not find or load a specific file. (0x80131621)

## PS 7.4
Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. Could not find or load a specific file. (0x80131621)

Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. Could not find or load a specific file. (0x80131621)

Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. Could not find or load a specific file. (0x80131621)

# Bundled Microsoft.Bcl.AsyncInterfaces
(No error, just unexpected version)

Environment data

AsyncInterfaces library to PowerShell version data can be found here:
bcl-version-data.csv

C# PowerShell module import test results can be found here:
import-test-results.csv

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions