microsoft / vscode-azurefunctions

Azure Functions extension for VS Code
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions
MIT License
289 stars 131 forks source link

PowerShell debugging stability problems #2734

Open v-ruizh opened 3 years ago

v-ruizh commented 3 years ago

OS: Win 10 and Linux Build Version: 20210304.27 PowerShell: 7.1.2

Repro Steps:

  1. Create a PowerShell project and set a breakpoint in it.
  2. Debug this project.
  3. Copy the function url and execute "curl ?name=test" in Terminal.

Expect: The breakpoint is hit.

Actual: The breakpoint is not hit.

Glober777 commented 3 years ago

I'm experiencing the same thing. Tried with both HTTP and Timer triggers. Functions run just fine but the execution almost never gets interrupted at breakpoint (it worked only twice out of tens of retries).

OS: Windows 10 (2004) VSCode: 1.54 and 1.54.1 PowerShell: Windows PowerShell 5.1, PowerShell 7.1

Glober777 commented 3 years ago

I suspect that it may be related to the same issue that is causing #2656 to occur ( microsoft/vscode#118256).

ejizba commented 3 years ago

We've seen a number of PowerShell debugging issues filed lately. It seems they might all have the same root cause: https://github.com/PowerShell/PowerShellEditorServices/issues/1295, see this comment in particular.

I'll use this issue as the main tracker in our repo.

codaamok commented 2 years ago

Me too!

JustinGrote commented 2 years ago

@ejizba Now being tracked here: https://github.com/PowerShell/PowerShellEditorServices/issues/1446#issuecomment-981326899

aistvan commented 2 years ago

Same for me on all of my 3 dev pc.

StewartRyanSony commented 2 years ago

I'm running into the same problem. Plus I'm getting the following error in the Debug Console

Internal Error - System.Management.Automation.PSInvalidOperationException: The pipeline was not run because a pipeline is already running. Pipelines cannot be run concurrently.
   at System.Management.Automation.RemotePipeline.DoConcurrentCheck(Boolean syncCall)
   at System.Management.Automation.RemoteRunspace.DoConcurrentCheckAndAddToRunningPipelines(RemotePipeline pipeline, Boolean syncCall)
   at System.Management.Automation.RemotePipeline.InitPowerShell(Boolean syncCall, Boolean invokeAndDisconnect)
   at System.Management.Automation.RemotePipeline.Invoke(IEnumerable input)
   at System.Management.Automation.RemoteSessionStateProxy.get_LanguageMode()
   at Microsoft.PowerShell.EditorServices.Services.PowerShellContextService.ExecuteScriptStringAsync(String scriptString, StringBuilder errorMessages, Boolean writeInputToHost, Boolean writeOutputToHost, Boolean addToHistory) in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShellContext\PowerShellContextService.cs:line 1019
   at Microsoft.PowerShell.EditorServices.Services.PowerShellContextService.ExecuteScriptStringAsync(String scriptString, Boolean writeInputToHost, Boolean writeOutputToHost) in D:\a\1\s\src\PowerShellEditorServices\Services\PowerShellContext\PowerShellContextService.cs:line 980
   at Microsoft.PowerShell.EditorServices.Handlers.DebugEvaluateHandler.Handle(EvaluateRequestArguments request, CancellationToken cancellationToken) in D:\a\1\s\src\PowerShellEditorServices\Services\DebugAdapter\Handlers\DebugEvaluateHandler.cs:line 42
   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()