question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`PowerShellEditorServices.Commands.psd1` MissingMethodException

See original GitHub issue

Hello,

The powershell terminal in v5.1 doesn’t start anymore: it stays stuck in “starting powershell”. This does not happen with the PS terminal in 7.1.3. In the editorServices.log, I have this message:

2021-04-15 12:25:32.467 +02:00 [ERR] Execution of the following command(s) completed with errors:

    Import-Module C:\Users\UUUUUUUU\.vscode\extensions\ms-vscode.powershell-2021.2.2\modules\PowerShellEditorServices\Commands\PowerShellEditorServices.Commands.psd1

2021-04-15 12:25:32.586 +02:00 [FTL] unhandled exception
System.[vscode-powershell.log](https://github.com/PowerShell/PSScriptAnalyzer/files/6317403/vscode-powershell.log)
[EditorServices.log](https://github.com/PowerShell/PSScriptAnalyzer/files/6317404/EditorServices.log)
[powershell editor services.txt](https://github.com/PowerShell/PSScriptAnalyzer/files/6317405/powershell.editor.services.txt)
[StartEditorServices.log](https://github.com/PowerShell/PSScriptAnalyzer/files/6317406/StartEditorServices.log)


: Méthode introuvable : 'System.Threading.Tasks.ValueTask System.IO.Pipelines.PipeReader.CompleteAsync(System.Exception)'.
   à OmniSharp.Extensions.JsonRpc.InputHandler.<ProcessInputStream>d__36.MoveNext()
   à System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
   à OmniSharp.Extensions.JsonRpc.InputHandler.ProcessInputStream(CancellationToken cancellationToken)
   à OmniSharp.Extensions.JsonRpc.InputHandler.<Start>b__27_0()
   à System.Reactive.Linq.QueryLanguage.StartAsyncImpl(Func`1 actionAsync, IScheduler scheduler)

Tried to downgrade to old vscode and addon version: same error. Logs vscode in diagnostic mode attached. Thx for support.

powershell editor services.txt StartEditorServices.log vscode-powershell.log EditorServices.log

Steps to reproduce

open VScode
open a PS script in VScode
message "starting powershell" appears at the bottom right of your code after a few seconds
Message =====> PowerShell Integrated Console v2021.2.2 <===== in the Terminal

Expected behavior

message "powershell" appears at the bottom right of your code after a few seconds
message =====> PowerShell Integrated Console v2021.2.2 <=====
PS C:\xxxxxxxxxx>
in the Terminal

Actual behavior

Message "starting powershell" appears at the bottom right of your code after a few seconds
no prompt in terminal, so no way to execute commands
Run a script displays this message: 
_Cannot debug or run a PowerShell script until the PowerShell session has started. Wait for the PowerShell session to finish starting and try again. 
source powershell (extension)

Environment data

VScode version:

Version : 1.55.2 (user setup)
Commit : 3c4e3df9e89829dce27b7b5c24508306b151f30d
Date : 2021-04-13T09:35:57.887Z
Electron : 11.3.0
Chrome : 87.0.4280.141
Node.js : 12.18.3
V8 : 8.7.220.31-electron.0
OS : Windows_NT x64 10.0.17763

Addon Powershell version: 2021.2.2

> $PSVersionTable (from windows powershell ISE)
Name                           Value                                                                                                                                                                                            
----                           -----                                                                                                                                                                                            
PSVersion                      5.1.17763.1490                                                                                                                                                                                   
PSEdition                      Desktop                                                                                                                                                                                          
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                                                                                          
BuildVersion                   10.0.17763.1490                                                                                                                                                                                  
CLRVersion                     4.0.30319.42000                                                                                                                                                                                  
WSManStackVersion              3.0                                                                                                                                                                                              
PSRemotingProtocolVersion      2.3                                                                                                                                                                                              
SerializationVersion           1.1.0.1     


> (Get-Module -ListAvailable PSScriptAnalyzer).Version | ForEach-Object { $_.ToString() } (from vscode with PS terminal 7.1.3
1.19.1

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:17 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
anankee26commented, Jun 21, 2021

Hello @andschwa

yes the first error with v2021.2.2 doesnt’t appear now. I agree that it is better to debug the one that is currently present with v2021.2.2. Unless v2021.2.2 is hidden by v2021.5.1 ! We’ll see if we can fix the DryIoc … 😉

1reaction
andschwacommented, Jun 11, 2021

I think this may be related to issues in general with the assemblies shipped for PowerShell 5.1 support. Our use of .NET 6 (because of our support of PowerShell 7.2.x) brought in a bug with dotnet (https://github.com/dotnet/sdk/issues/18101) which caused #3395. I’ll get the workaround in place for that, or they’ll fix it upstream, and then we can test if it resolves this issue too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

PowerShell
PowerShellEditorServices.Commands.psd1 MissingMethodException $ 0. Created 1 year ago in PowerShell/vscode-powershell with 6 comments. Hello,.
Read more >
Visual Studio Code Powershell startup failure
Apparently, the Start-EditorServices command being executed with -StartupBanner parameter contains a character ( < ), which seems to be ...
Read more >
Visual Studio Code editing features for PowerShell ...
This will configure Visual Studio Code to use the PSScriptAnalyzerSettings.psd1 file in the root of your workspace folder to determine which ...
Read more >
PowerShell/PowerShellEditorServices
Commands.psd1. Phillip Tola ... If I run the command in a console, it fires the "hadErrors":true ... PSScriptAnalyzer Plaster PowerShellEditorServices ...
Read more >
PowerShell - Visual Studio Marketplace
Develop PowerShell modules, commands and scripts in Visual Studio Code! ... PowerShellEditorServices is the server and vscode-powershell is ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found