PowerShell / PowerShellStandard

MIT License
158 stars 23 forks source link

dotnet template incorrectly sets the Standard Library version #92

Open KubaP opened 3 years ago

KubaP commented 3 years ago

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.

JustinGrote commented 3 years ago

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?