PowerShellStandard icon indicating copy to clipboard operation
PowerShellStandard copied to clipboard

V5 reference assembly has incorrect signature for ScriptBlockAst.UsingStatements

Open lzybkr opened this issue 7 years ago • 3 comments

The nuget package Microsoft.PowerShell.5.ReferenceAssemblies has an incorrect signature for ScriptBlockAst.UsingStatements, it uses:

public ReadOnlyCollection<StatementAst> UsingStatements { get; set; }

The correct signature is used in this repo:

public ReadOnlyCollection<UsingStatementAst> UsingStatements { get; set; }

As a consequence of the incorrect signature, any use of this property built against Microsoft.PowerShell.5.ReferenceAssemblies will result in a potentially hard to diagnose MissingMethodException.

lzybkr avatar Jul 11 '18 18:07 lzybkr

Was there a change in Windows PowerShell V5 which changed this (say after 2 years ago, when it was originally published)? The reference assemblies for V5 were extracted from the windows build.

JamesWTruher avatar Jul 12 '18 18:07 JamesWTruher

Possibly, I don't remember.

I don't have V5 handy, just V5.1 and V6. If you check V5 and it matches the reference assembly, then I guess it's by design and maybe we need a V5.1 reference assembly.

lzybkr avatar Jul 12 '18 19:07 lzybkr

looks like it's correct in 5.1. I'm working on creating a 5.1 reference nupkg now

JamesWTruher avatar Oct 23 '18 23:10 JamesWTruher