PowerShellStandard icon indicating copy to clipboard operation
PowerShellStandard copied to clipboard

dotnet template incorrectly sets the Standard Library version

Open KubaP opened this issue 4 years ago • 1 comments

The issue The issue seems to lie with the template. On creation of a new project, the .csproj file is populated with the ps standard library reference like so:

<PackageReference Include="PowerShellStandard.Library" Version="5.1.0-preview-06">
...

With this preview reference, the intellisense will not work correctly for the powershell-related annotations in the source code, such as the [Cmdlet(...)] annotation (intellisense for standard c# features works correctly). This issue is present when using the latest VSCode C# extension.

The version number however should be just 5.1.0. With this reference, the C# extesion provides correct intellisense.

Steps to reproduce

dotnet new -i Microsoft.PowerShell.Standard.Module.Template

dotnet new psmodule

Open the TestSampleCmdletCommand.cs file in VSCode, and invoke intellisense on one of the powershell related annotations, such as the VerbDiagnostic.Test symbol; no relevant intellisense will show up.

KubaP avatar May 05 '21 12:05 KubaP

Further this should be expanded to the new 7 preview as well, as I've had a lot more success with that.

@SteveL-MSFT @xtqqczze no new commits n nearly a year, is there still a maintainer on this?

JustinGrote avatar May 05 '21 15:05 JustinGrote