Skip to content
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

Visual Studio Code fails to launch PowerShell terminal on startup #4258

Closed
3 tasks done
hisae1421 opened this issue Nov 7, 2024 · 8 comments
Closed
3 tasks done

Visual Studio Code fails to launch PowerShell terminal on startup #4258

hisae1421 opened this issue Nov 7, 2024 · 8 comments

Comments

@hisae1421
Copy link

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues, especially the pinned issues.

Exception report

Every time I open Visual Studio Code I have the following error message in the PowerShell terminal :
"
Exception encountered starting EditorServices. Exception logged in C:\__w\1\s\src\PowerShellEditorServices.Hosting\Commands\StartEditorServicesCommand.cs on line 239 in EndProcessing:
System.MissingMethodException: Méthode introuvable : 'Microsoft.Extensions.Logging.ILoggerFactory Serilog.SerilogLoggerFactoryExtensions.AddSerilog(Microsoft.Extensions.Logging.ILoggerFactory, Serilog.ILogger, Boolean)'.
   à Microsoft.PowerShell.EditorServices.Hosting.EditorServicesServerFactory.Create(String logDirectoryPath, Int32 minimumLogLevel, IObservable`1 hostLogger)
   à Microsoft.PowerShell.EditorServices.Hosting.EditorServicesRunner..ctor(HostLogger logger, EditorServicesConfig config, ISessionFileWriter sessionFileWriter, IReadOnlyCollection`1 loggersToUnsubscribe)   
   à Microsoft.PowerShell.EditorServices.Hosting.EditorServicesLoader.LoadAndRunEditorServicesAsync()
   à Microsoft.PowerShell.EditorServices.Commands.StartEditorServicesCommand.EndProcessing()

== Press any key to close terminal ==
"

I reinstalled both Visual Studio Code and the PowerShell module

Here are the environment info :
Version : 1.95.1 (user setup)
Validation : 65edc4939843c90c34d61f4ce11704f09d3e5cb6
Date : 2024-10-31T05:14:54.222Z
Electron : 32.2.1
ElectronBuildId : 10427718
Chromium : 128.0.6613.186
Node.js : 20.18.0
V8 : 12.8.374.38-electron.0
Système d’exploitation : Windows_NT x64 10.0.19045

Screenshot

image

Environment data

PS Version: 5.1.19041.5007
PS HostName: ConsoleHost
PSReadLine Version: 2.0.0-beta2
PSReadLine EditMode: Windows
OS: 10.0.19041.4522 (WinBuild.160101.0800)
BufferWidth: 226
BufferHeight: 34

Steps to reproduce

Visual Studio launches PowerShell terminal

Expected behavior

I don't understand.... Expected behavior is not to have an error message I guess ?

Actual behavior

Shows the error message above

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Nov 7, 2024
Copy link

github-actions bot commented Nov 7, 2024

@hisae1421, you were using a pretty old version of PSReadLine (2.0.0-beta2 or prior), and it's likely that the issue was fixed in a newer version.
Please upgrade to the 2.3.5 version of PSReadLine from PowerShell Gallery.
See the upgrading section for instructions. Please let us know if you run into the same issue with the latest version.

@github-actions github-actions bot closed this as completed Nov 7, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Nov 7, 2024
@hisae1421
Copy link
Author

Hi, I use the latest already :
image

Has to be something else :( this is from the visual studio code that shows me the issue every time by the way, not another PowerShell environment

@Growbutski
Copy link

Growbutski commented Nov 12, 2024

Hi, I seem to run in to the same issue:

image

@Growbutski
Copy link

I only get the error in the new powershell extension version. Version 2024.4.0 works fine.

@hisae1421
Copy link
Author

I also have it when i revert back to older version but indeed the issue started last week, probably when 2024.5.0 got deployed

@hisae1421
Copy link
Author

I solved it by installing PowerShell 7 but I don't understand why vsCode extension is not compliant anymore with my default 5.1 powershell environement

@hisae1421
Copy link
Author

Why can't I set this issue to opened ? Some bot said something wrong about it and that's it ? Archived forever ? 😂

@daxian-dbw
Copy link
Member

@hisae1421 and @Growbutski The exception indicates it's a problem with PS VSCode extension, not PSReadLine. Please report your issue in https://github.com/PowerShell/vscode-powershell instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants