Skip to content

Exception encountered starting EditorServices #5107

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

Closed
1 of 6 tasks
Daniel-Gull opened this issue Nov 30, 2024 · 2 comments
Closed
1 of 6 tasks

Exception encountered starting EditorServices #5107

Daniel-Gull opened this issue Nov 30, 2024 · 2 comments
Labels
Area-Startup Issue-Bug A bug to squash. Resolution-Duplicate Will close automatically.

Comments

@Daniel-Gull
Copy link

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all open and closed issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
  • If this is a security issue, I have read the security issue reporting guidance.

Summary

I get this error message when I open an empty file named xxx.ps1 in VSCode.

PowerShell Version

Name             : ConsoleHost
Version          : 5.1.19041.3570
InstanceId       : d8ee5b8a-20a6-4d8b-9adc-e1dbbf1133e8
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : en-US
CurrentUICulture : en-US
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace

Visual Studio Code Version

PS C:\Users\username> code --version
1.95.3
f1a4fb101478ce6ec82fe9627c43efbf9e98c813
x64

Extension Version

PS C:\Users\username> code --list-extensions --show-versions | Select-String powershell
[email protected]

Steps to Reproduce

drag and drop an empty file with the name "xxx.ps1" into VS Code with the above referred PowerShell extension from Microsoft

Visuals

No response

Logs

Exception encountered starting EditorServices. Exception logged in C:__w\1\s\src\PowerShellEditorServices.Hosting\Commands\StartEditorServicesCommand.cs on line 239 in EndProcessing:
System.MissingMethodException: Method not found: 'Microsoft.Extensions.Logging.ILoggerFactory Serilog.SerilogLoggerFactoryExtensions.AddSerilog(Microsoft.Extensions.Logging.ILoggerFactory, Serilog.ILogger, Boolean)'.
at Microsoft.PowerShell.EditorServices.Hosting.EditorServicesServerFactory.Create(String logDirectoryPath, Int32 minimumLogLevel, IObservable1 hostLogger) at Microsoft.PowerShell.EditorServices.Hosting.EditorServicesRunner..ctor(HostLogger logger, EditorServicesConfig config, ISessionFileWriter sessionFileWriter, IReadOnlyCollection1 loggersToUnsubscribe)
at Microsoft.PowerShell.EditorServices.Hosting.EditorServicesLoader.LoadAndRunEditorServicesAsync()
at Microsoft.PowerShell.EditorServices.Commands.StartEditorServicesCommand.EndProcessing()

11/30/2024 7:43:16 AM [NORMAL] - Visual Studio Code: v1.95.3 64-bit on Windows 64-bit

11/30/2024 7:43:16 AM [NORMAL] - PowerShell Extension: v2024.4.0

11/30/2024 7:43:16 AM [NORMAL] - Starting 'Windows PowerShell (x86)' at: C:\WINDOWS\SysWOW64\WindowsPowerShell\v1.0\powershell.exe

11/30/2024 7:43:16 AM [NORMAL] - PowerShell process started with PID: 15696

11/30/2024 7:43:33 AM [WARNING] - PowerShell process terminated or Extension Terminal was closed, PID: 15696

11/30/2024 7:43:33 AM [ERROR] - Extension Terminal is undefined.

11/30/2024 7:43:33 AM [ERROR] - PowerShell Language Server process didn't start!

@Daniel-Gull Daniel-Gull added Issue-Bug A bug to squash. Needs: Triage Maintainer attention needed! labels Nov 30, 2024
@JustinGrote
Copy link
Collaborator

Thanks for the report! Try the latest extension preview, we have removed serilog which causes these conflicts. If you also use PowerShell 7, that should resolve the issue as well.

@JustinGrote JustinGrote removed the Needs: Triage Maintainer attention needed! label Nov 30, 2024
@JustinGrote
Copy link
Collaborator

Dupe of #5084

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Startup Issue-Bug A bug to squash. Resolution-Duplicate Will close automatically.
Projects
None yet
Development

No branches or pull requests

2 participants