-
Notifications
You must be signed in to change notification settings - Fork 513
Powershell script with Generic method call cannot be edited in VS Code #4842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks @hshenMcc can you please also provide a screen shot of what are you are seeing? |
This issue has been labeled as needing feedback and has not had any activity for one or more weeks. It has been closed for housekeeping purposes. |
Thanks @hshenMcc are you able to provide your entire script? |
Ah nevermind the above message @hshenMcc, in the triage meeting I didn't see you had already provided the script |
We we're able to reproduce this outside of VSCode so it is a PowerShell issue-- @SeeminglyScience is going to create an issue in PowerShell/PowerShell |
This issue has been labeled as resolved, please verify the provided fix (or other reason). |
This issue has been labeled as needing fix verification and has not had any activity a week. It has been closed for housekeeping purposes. |
Where ever the issue is, which release on which product (VS Code/Powershell) has the fix? Thanks. |
@hshenMcc there is no fix yet but if there is one, it will land in PowerShell and (hopefully) be available in the next release after that, which is currently PS7.5. The vscode side will "just work" when that's completed. |
Prerequisites
Summary
call [System.Text.Json.JsonSerializer]::Serialize in a powershell script. The script runs ok in VS code. But after editing anything in the script, the script failed at the call of [System.Text.Json.JsonSerializer]::Serialize. No issue if run the modified script in pwsh directly.
PowerShell Version
Visual Studio Code Version
Extension Version
[email protected]
Steps to Reproduce
testJson.zip
testJson.ps1 in the zip can run no problem in VS Code with output
But if remove 1 in "this1", and run the script again in VS code, got output as
Line |
24 | $jsonString = [System.Text.Json.JsonSerializer]::Serialize[Person]($p …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Could not find a suitable generic method overload for "Serialize" with "1" type parameters, and the argument count: "1".
this:
No issue to run the modified script in pwsh. Something is wrong in Powershell extension.
Visuals
No response
Logs
No response
The text was updated successfully, but these errors were encountered: