Skip to content

PowerShell Extension Issue #4569

@mehmetalicinal

Description

@mehmetalicinal

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

When I open visual studio code, I get the following error. System Reactive dll version is 5.0.0.1 on my computer. Is ıt becacuse of that ?

Exception encountered starting EditorServices. Exception logged in D:\a_work\1\s\src\PowerShellEditorServices.Hosting\Commands\StartEditorServicesCommand.cs on line 236 in EndProcessing:
System.BadImageFormatException: Could not load file or assembly 'System.Reactive, Version=5.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263'. An attempt was made to load a program with an incorrect format.
File name: 'System.Reactive, Version=5.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263' ---> System.BadImageFormatException: Bad IL format. The format of the file 'C:\Users\mehmetali.cinal.vscode\extensions\ms-vscode.powershell-2023.5.0\modules\PowerShellEditorServices\bin\Common\System.Reactive.dll' is invalid.
at System.Runtime.Loader.AssemblyLoadContext.g____PInvoke|5_0(IntPtr ptrNativeAssemblyBinder, UInt16* ilPath, UInt16* niPath, ObjectHandleOnStack retAssembly)
at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath)
at Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext.Load(AssemblyName assemblyName) in D:\a_work\1\s\src\PowerShellEditorServices.Hosting\Internal\PsesLoadContext.cs:line 48
at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingLoad(AssemblyName assemblyName)
at System.Runtime.Loader.AssemblyLoadContext.Resolve(IntPtr gchManagedAssemblyLoadContext, AssemblyName assemblyName)
at OmniSharp.Extensions.JsonRpc.JsonRpcServerOptionsBase1..ctor() at OmniSharp.Extensions.LanguageServer.Protocol.LanguageProtocolRpcOptionsBase1..ctor()
at OmniSharp.Extensions.LanguageServer.Server.LanguageServerOptions..ctor()
at OmniSharp.Extensions.LanguageServer.Server.LanguageServer.From(Action1 optionsAction, IServiceProvider outerServiceProvider, CancellationToken cancellationToken) at OmniSharp.Extensions.LanguageServer.Server.LanguageServer.From(Action1 optionsAction)
at Microsoft.PowerShell.EditorServices.Server.PsesLanguageServer.StartAsync() in D:\a_work\1\s\src\PowerShellEditorServices\Server\PsesLanguageServer.cs:line 77
at Microsoft.PowerShell.EditorServices.Hosting.EditorServicesRunner.CreateEditorServicesAndRunUntilShutdown() in D:\a_work\1\s\src\PowerShellEditorServices.Hosting\Internal\EditorServicesRunner.cs:line 180
at Microsoft.PowerShell.EditorServices.Commands.StartEditorServicesCommand.EndProcessing() in D:\a_work\1\s\src\PowerShellEditorServices.Hosting\Commands\StartEditorServicesCommand.cs:line 231

PowerShell Version

Name                           Value
----                           -----
PSVersion                      7.3.4
PSEdition                      Core
GitCommitId                    7.3.4
OS                             Microsoft Windows 10.0.22000
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0�}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visual Studio Code Version

1.78.1
x64

Extension Version

ms-vscode.powershell@2023.5.0

Steps to Reproduce

Exception encountered starting EditorServices. Exception logged in D:\a_work\1\s\src\PowerShellEditorServices.Hosting\Commands\StartEditorServicesCommand.cs on line 236 in EndProcessing:
System.BadImageFormatException: Could not load file or assembly 'System.Reactive, Version=5.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263'. An attempt was made to load a program with an incorrect format.
File name: 'System.Reactive, Version=5.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263' ---> System.BadImageFormatException: Bad IL format. The format of the file 'C:\Users\mehmetali.cinal.vscode\extensions\ms-vscode.powershell-2023.5.0\modules\PowerShellEditorServices\bin\Common\System.Reactive.dll' is invalid.
at System.Runtime.Loader.AssemblyLoadContext.g____PInvoke|5_0(IntPtr ptrNativeAssemblyBinder, UInt16* ilPath, UInt16* niPath, ObjectHandleOnStack retAssembly)
at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath)
at Microsoft.PowerShell.EditorServices.Hosting.PsesLoadContext.Load(AssemblyName assemblyName) in D:\a_work\1\s\src\PowerShellEditorServices.Hosting\Internal\PsesLoadContext.cs:line 48
at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingLoad(AssemblyName assemblyName)
at System.Runtime.Loader.AssemblyLoadContext.Resolve(IntPtr gchManagedAssemblyLoadContext, AssemblyName assemblyName)
at OmniSharp.Extensions.JsonRpc.JsonRpcServerOptionsBase1..ctor() at OmniSharp.Extensions.LanguageServer.Protocol.LanguageProtocolRpcOptionsBase1..ctor()
at OmniSharp.Extensions.LanguageServer.Server.LanguageServerOptions..ctor()
at OmniSharp.Extensions.LanguageServer.Server.LanguageServer.From(Action1 optionsAction, IServiceProvider outerServiceProvider, CancellationToken cancellationToken) at OmniSharp.Extensions.LanguageServer.Server.LanguageServer.From(Action1 optionsAction)
at Microsoft.PowerShell.EditorServices.Server.PsesLanguageServer.StartAsync() in D:\a_work\1\s\src\PowerShellEditorServices\Server\PsesLanguageServer.cs:line 77
at Microsoft.PowerShell.EditorServices.Hosting.EditorServicesRunner.CreateEditorServicesAndRunUntilShutdown() in D:\a_work\1\s\src\PowerShellEditorServices.Hosting\Internal\EditorServicesRunner.cs:line 180
at Microsoft.PowerShell.EditorServices.Commands.StartEditorServicesCommand.EndProcessing() in D:\a_work\1\s\src\PowerShellEditorServices.Hosting\Commands\StartEditorServicesCommand.cs:line 231

Visuals

No response

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions