-
Notifications
You must be signed in to change notification settings - Fork 499
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
2024.4.0: Unable to start when using Windows PowerShell if older Serilog is already present #5084
2024.4.0: Unable to start when using Windows PowerShell if older Serilog is already present #5084
Comments
@ajacks88 thanks for your submission! We can't reproduce, maybe you can help us narrow down your environment. The nature of this error almost always means that something else in your environment is loading an older or otherwise incompatible
CC @andyleejordan for 👀 |
@andyleejordan I think it might be time for us to start catching these methodNotFound exceptions during startup and reporting some added guidance in this regard. |
I have the same problem. After update to v.2024.4.0 it can not load powershell 5.1 sessions (powershell 7 works but I need pwsh 5.1). Error code: https://aka.ms/vscode-powershell [ERROR] - PowerShell Language Server process didn't start! When i roll back to v2024.2.2 it works just fine. |
Nothing new to add, just reinforcing the issue. Exact same symptoms, and rolling back to v2024.2.2 did the trick. |
@ajacks88 @Phillip-Ian @Azburkabas we can't reproduce this anywhere, so we have to figure out what is different about your environment.
|
Same problem, as @Phillip-Ian proposed, I rolledback to v2024.2.2 and all good |
@ferjea01 thanks! As previously stated we can't reproduce so if you can provide the info requested here: It might help us narrow it down. |
Hi, i wrote above that powershell 7 works, but i needed pws 5.1 for all msonline/graph etc... pws modules. I tried uninstalling vscode and cleaning all config folders and install everyting from scratch (with no other vs code extensions except powershell extension and it still didn't work). Reverting to v2024.2.2. works just fine |
Hi @JustinGrote , We need powershell 5.1 for Windows related module (msmq and iis stuff such as webbinding, appPool configuration, etc) . My collegue also had the same problem on his computer. We have theses modules installed : We have Windows 10 Enterprise 22h2 19045.5011. Could any security update created that glitch? |
Hm, this was tested against Microsoft Windows Server 2022 10.0.20348. @dkattan was hitting almost this exact same failure scenario with the "mission method" from the logger in https://github.com/PowerShell/PowerShellEditorServices/issues/1477#issuecomment-863154520...seems like there's an incompatible version of Serilog in the GAC on these versions of Windows where it's failing, and that's getting picked up before our own, and we did bump the versions of Serilog twice. In my opinion @JustinGrote and @SeeminglyScience we should dump Serilog and Microsoft.Extensions.Logging entirely, since we're required to keep it up-to-date, but doing so results in package incompatibles for 5.1 thanks to the GAC. We just need to minimize our dependencies entirely. |
@andyleejordan been working extensively on a logging rewrite on another branch, so I know a lot of the internals here. MEL is part of the omnisharp LSP server so I don't think we can ditch that, but we can ditch serilog for sure in favor of a simple MEL fileprovider, or, in my model, I've been transitioning the logging to go over the LSP as logMessage once the bootstrap completes. MEL and Serilog both get ALC'd in PS7 but obviously not doable in 5.1 EDIT: I can write a provider for Rob's dependency-less bootstrap logger to continue file logging there to replace Serilog, since all it's used for is the file log (and logs would be duplicated after LSP startup, both local and remote, so we can probably reduce the severity to warning for the local log just to capture exceptions that would not make it over the LSP logger connection. |
Yeah, MEL looks like it will stick around for a bit. Serilog should really go though. While there are hits for Serilog in OmniSharp as far as I can tell they're only in tests, so if we get rid of it, I think it's gone. I would much prefer logging over LSP anyway, and yes as you say, just keep a file (probably not even on by default?) for logs pre-LSP for when we need to debug that bit. If we make that diagnostic only it can probably be a dead simple file logger. |
Also we'd get to resolve PowerShell/PowerShellEditorServices#1477 since that ALSO: We don't even use Serilog the way it's meant to be. It has all this purpose for structured logging and we just send it garbage. |
#2538 reopened for historical as well, should be addressed and closed with whatever PR fixes this. |
For anyone else potentially experiencing this issue, please capture a diagnostic trace and upload to this issue. If you aren't getting the MEL logger exception, your issue may be different, but this is most likely being caused by the Serilog version bump as @andyleejordan noted. |
Hopefully PowerShell/PowerShellEditorServices#2197 fixes this. In the meantime please downgrade to the previous version. |
Hey everyone, thanks for your patience, @andyleejordan should get out a preview release tomorrow that should have this fixed, we will notify here and if you still have issues let us know. |
After updating the extension to the preview release I now get the following error hell.EditorServices.Commands.StartEditorServicesCommand.EndProcessing() == Press any key to close terminal == |
@jsantoro339as the new prerelease hasn't been released yet, very soon! We ran into an internal verification build problem, I expect @andyleejordan will get that sorted today or tomorrow. |
It's out! Go to your extensions and choose "switch to pre-release" in the right click menu and let us know if this fixes it for you! |
@JustinGrote Yes, I just updated it and it is working again. Thank you team, for addressing the issue and getting the fix out. |
So glad to hear it! |
Hey @ajacks88 @Azburkabas @Phillip-Ian the fix for this is in the pre-release version of the extension, can you all please give it a try? Thanks! |
Prerequisites
Summary
Attempting to launch vscode's powershell extension and get an error. Googling found others with the same issue.
PowerShell Version
Visual Studio Code Version
Extension Version
[email protected]
Steps to Reproduce
Launch vscode, get the following error:
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, 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()
Visuals
No response
Logs
No response
The text was updated successfully, but these errors were encountered: