Skip to content

Enable Windows Arm64 #2237

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tsmarvin
Copy link

PR Summary

  • Make LoadAssemblyInPsesLoadContext an Instance method instead of static to fix a crash on windows arm64.
  • Add .vs directory to git ignore.
    • I realize this repo is primarily related to vscode, but I did open the solution in visual studio and wanted to ensure I didnt accidentally commit my state files.
  • Remove unnecessary extra word in extension comment.

PR Context

I am experiencing crashes in the PSES internal host on Windows 11 arm64 (the qualcomm devkit). Here is an error log captured while print debugging showing the error:

2025-06-29 03:10:30.862 [info] Visual Studio Code: v1.102.0-insider 64-bit on Windows 64-bit
2025-06-29 03:10:30.862 [info] PowerShell Extension: v2025.3.1
2025-06-29 03:10:30.862 [info] Starting 'PowerShell (x64)' at: C:\Program Files (Arm)\PowerShell\7\pwsh.exe
2025-06-29 03:10:31.376 [info] PowerShell process started with PID: 26092
2025-06-29 03:10:35.772 [info] [PSES] Trace: OmniSharp.Extensions.JsonRpc.DefaultRequestInvoker: Failed to handle request initialize 0 - System.Management.Automation.ActionPreferenceStopException: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Method invocation failed because [Microsoft.PowerShell.EditorServices.Extensions.Services.EditorExtensionServiceProvider] does not contain a method named 'LoadAssemblyInPsesLoadContext'.
   at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
   at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility.PowerShellExtensions.InvokeAndClear(PowerShell pwsh, PSInvocationSettings invocationSettings) in C:\Users\tmarvin\OneDrive\Development\Working\tmp\PowerShellEditorServices\src\PowerShellEditorServices\Services\PowerShell\Utility\PowerShellExtensions.cs:line 88
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility.PowerShellExtensions.InvokeCommand(PowerShell pwsh, PSCommand psCommand, PSInvocationSettings invocationSettings) in C:\Users\tmarvin\OneDrive\Development\Working\tmp\PowerShellEditorServices\src\PowerShellEditorServices\Services\PowerShell\Utility\PowerShellExtensions.cs:line 105
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility.PowerShellExtensions.LoadProfiles(PowerShell pwsh, ProfilePathInfo profilePaths) in C:\Users\tmarvin\OneDrive\Development\Working\tmp\PowerShellEditorServices\src\PowerShellEditorServices\Services\PowerShell\Utility\PowerShellExtensions.cs:line 219
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.<LoadHostProfilesAsync>b__113_0(PowerShell pwsh, CancellationToken _) in C:\Users\tmarvin\OneDrive\Development\Working\tmp\PowerShellEditorServices\src\PowerShellEditorServices\Services\PowerShell\Host\PsesInternalHost.cs:line 592
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution.SynchronousPSDelegateTask.Run(CancellationToken cancellationToken) in C:\Users\tmarvin\OneDrive\Development\Working\tmp\PowerShellEditorServices\src\PowerShellEditorServices\Services\PowerShell\Execution\SynchronousDelegateTask.cs:line 95
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution.SynchronousTask`1.ExecuteSynchronously(CancellationToken executorCancellationToken) in C:\Users\tmarvin\OneDrive\Development\Working\tmp\PowerShellEditorServices\src\PowerShellEditorServices\Services\PowerShell\Execution\SynchronousTask.cs:line 92
--- End of stack trace from previous location ---
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.TryStartAsync(HostStartOptions startOptions, CancellationToken cancellationToken) in C:\Users\tmarvin\OneDrive\Development\Working\tmp\PowerShellEditorServices\src\PowerShellEditorServices\Services\PowerShell\Host\PsesInternalHost.cs:line 312
   at OmniSharp.Extensions.LanguageServer.Server.LanguageServer.MediatR.IRequestHandler<OmniSharp.Extensions.LanguageServer.Protocol.Models.InternalInitializeParams,OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeResult>.Handle(InternalInitializeParams request, CancellationToken token)
   at OmniSharp.Extensions.LanguageServer.Server.Pipelines.SemanticTokensDeltaPipeline`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at OmniSharp.Extensions.LanguageServer.Server.Pipelines.ResolveCommandPipeline`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at MediatR.Pipeline.RequestPreProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at MediatR.Pipeline.RequestPostProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at MediatR.Pipeline.RequestExceptionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at MediatR.Pipeline.RequestExceptionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at MediatR.Pipeline.RequestExceptionActionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at MediatR.Pipeline.RequestExceptionActionProcessorBehavior`2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
   at OmniSharp.Extensions.JsonRpc.RequestRouterBase`1.<RouteRequest>g__InnerRoute|7_0(IServiceScopeFactory serviceScopeFactory, Request request, TDescriptor descriptor, Object params, CancellationToken token, ILogger logger)
   at OmniSharp.Extensions.JsonRpc.RequestRouterBase`1.RouteRequest(IRequestDescriptor`1 descriptors, Request request, CancellationToken token)
   at OmniSharp.Extensions.JsonRpc.DefaultRequestInvoker.<>c__DisplayClass10_0.<<RouteRequest>b__5>d.MoveNext() | Method='initialize' RequestId='0'
2025-06-29 03:10:35.773 [info] [PSES] Trace: OmniSharp.Extensions.LanguageServer.Server.LspServerOutputFilter: Tried to send request or notification before initialization was completed and will be sent later OmniSharp.Extensions.JsonRpc.Server.Messages.InternalError | @Request='OmniSharp.Extensions.JsonRpc.Server.Messages.InternalError'

I looked through the codebase but unfortunately I wasn't able to figure out where this specific method instance was being accessed from in order to have it search for the static method.

This, along with this pr, resolves the issues I'm experiencing and enables me to use the PowerShell extension for code formatting.

tsmarvin added 2 commits June 29, 2025 04:23
- Remove unnecessary extra word in extension comment
@tsmarvin tsmarvin changed the title Tsmarvin/enable windows arm64 Enable Windows Arm64 Jun 29, 2025
@tsmarvin
Copy link
Author

@microsoft-github-policy-service agree

@andyleejordan
Copy link
Member

Hi, we reviewed this in triage today and are trying to ascertain what is calling LoadAssemblyInPsesLoadContext as an instance method such that this problem occurs. Can you give us more environment details? In our code, it's only referenced as the definition (as it's the public API available). Based on the callstack you provided, it seems to be something specifically in your profile. We also checked EditorServicesCommandSuite and it's not using it, so we're not sure what's calling it in your logs.

@tsmarvin
Copy link
Author

tsmarvin commented Jul 29, 2025

I will attempt to make time to get you this information tonight.

Unfortunately, if I can't get to it tonight I'll be traveling and away from my arm devkit for a week so it'll otherwise have to wait.

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

Successfully merging this pull request may close these issues.

3 participants