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

When opening VSCode and when running PowerShell scripts, PowerShell crashes #5088

Closed
5 of 6 tasks
DawnWertz opened this issue Nov 13, 2024 · 4 comments
Closed
5 of 6 tasks
Labels
Issue-Bug A bug to squash. Needs: Fix Verification Please verify the fix for us! Resolution-Duplicate Will close automatically.

Comments

@DawnWertz
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 have a fresh install of VSCode with only the PowerShell extension installed. When I open VSCode, the PowerShell terminal crashes
Error PowerShell session unavailable for debugging!.
Error PowerShell Language Server process didn't start!
Error Loading the PowerShell extension is taking longer than expected. If you're using privilege enforcement software, this can affect start up performance.

. After the errors, a dialog box of "Couldn't find a debug adapter descriptor for debug type 'PowerShell' (extension might have failed to activate)."

LOG:
11/13/2024 1:54:01 PM [NORMAL] - Visual Studio Code: v1.95.2 64-bit on Windows 64-bit

11/13/2024 1:54:01 PM [NORMAL] - PowerShell Extension: v2024.4.0

11/13/2024 1:54:01 PM [NORMAL] - Starting 'Windows PowerShell (x64)' at: C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe

11/13/2024 1:54:02 PM [NORMAL] - PowerShell process started with PID: 17892

11/13/2024 1:54:11 PM [WARNING] - PowerShell process terminated or Extension Terminal was closed, PID: 17892

11/13/2024 1:54:12 PM [ERROR] - Extension Terminal is undefined.

11/13/2024 1:54:12 PM [ERROR] - PowerShell Language Server process didn't start!

11/13/2024 1:54:52 PM [NORMAL] - Starting 'Windows PowerShell (x64)' at: C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe

11/13/2024 1:54:52 PM [NORMAL] - PowerShell process started with PID: 9120

11/13/2024 1:55:22 PM [WARNING] - Loading the PowerShell extension is taking longer than expected. If you're using privilege enforcement software, this can affect start up performance.

11/13/2024 1:58:54 PM [ERROR] - Timed out waiting for session file!

11/13/2024 1:58:55 PM [ERROR] - PowerShell Language Server process didn't start!

11/13/2024 1:58:55 PM [ERROR] - PowerShell session unavailable for debugging!

PowerShell Version

Name                           Value                                                                                   
----                           -----                                                                                   
PSVersion                      5.1.22621.4249                                                                          
PSEdition                      Desktop                                                                                 
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                 
BuildVersion                   10.0.22621.4249                                                                         
CLRVersion                     4.0.30319.42000                                                                         
WSManStackVersion              3.0                                                                                     
PSRemotingProtocolVersion      2.3                                                                                     
SerializationVersion           1.1.0.1

Visual Studio Code Version

1.95.2
x64

Extension Version

ms-vscode.powershell@2024.4.0

Steps to Reproduce

Install VSCode
Install the PowerShell extension
Open VSCode. PowerShell Terminal crashes.
Open a PowerShell Script
Run the PowerShell Script
PowerShell terminal crashes

I am able to run commands in the PowerShell terminal window prior to its crashing, I just cannot run scripts.

Visuals

No response

Logs

StartEditorServices-6044.log
StartEditorServices-16448.log
vscode-powershell.log

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

Logs show

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, IObservable`1 hostLogger)
   at Microsoft.PowerShell.EditorServices.Hosting.EditorServicesRunner..ctor(HostLogger logger, EditorServicesConfig config, ISessionFileWriter sessionFileWriter, IReadOnlyCollection`1 loggersToUnsubscribe)
   at Microsoft.PowerShell.EditorServices.Hosting.EditorServicesLoader.LoadAndRunEditorServicesAsync()
   at Microsoft.PowerShell.EditorServices.Commands.StartEditorServicesCommand.EndProcessing()

Closing as dupe of #5084. We're working on it! :)

@JustinGrote JustinGrote added Resolution-Duplicate Will close automatically. and removed Needs: Triage Maintainer attention needed! labels Nov 13, 2024
Copy link
Contributor

This issue has been labeled as resolved, please verify the provided fix (or other reason).

@andyleejordan
Copy link
Member

Hey @DawnWertz the pre-release v2024..5.1-preview should be fixed for this. Can you give it a try and report back?

@DawnWertz
Copy link
Author

DawnWertz commented Nov 19, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug A bug to squash. Needs: Fix Verification Please verify the fix for us! Resolution-Duplicate Will close automatically.
Projects
None yet
Development

No branches or pull requests

3 participants