VS code powershell azure函数调试omnisharp异常

生活

我在调试 vs 代码中的 powershell 函数时遇到问题。VS 代码:1.68.0 Azure 核心工具:v4 Powershell:7

启动.json

{
  "version": "0.2.0",
  "configurations": [   
    
    {
      "name": "Attach to PowerShell Functions",
      "type": "PowerShell",
      "request": "attach",
      "customPipeName": "AzureFunctionsPSWorker",
      "runspaceId": 1,
      "preLaunchTask": "func: host start"      
    }    
  ]
}

和功能代码:

运行.ps1

using namespace System.Net

# Input bindings are passed in via param block.
param($Request, $TriggerMetadata)

# Write to the Azure Functions log stream.
Write-Host "PowerShell HTTP trigger function processed a request."

# Interact with query parameters or the body of the request.
$name = $Request.Query.Name
if (-not $name) {
    $name = $Request.Body.Name
}

$body = "This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response."

if ($name) {
    $body = "Hello, $name. This HTTP triggered function executed successfully."
}

# Associate values to output bindings by calling 'Push-OutputBinding'.
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
    StatusCode = [HttpStatusCode]::OK
    Body = $body
})

这个错误(请参阅异常链接)在我按下 f5 时立即发生。虽然我可以看到主机启动任务正在启动,但调试被此异常中断

有人可以帮我解决这个问题吗?

例外

HariKrishnaRajoli-MT

从我们的角度来看,在 VS Code 中调试 Azure Functions PowerShell 时遇到了同样的问题:

在此处输入图像描述

我尝试过不同的场景,但调试不起作用:

我建议在Omnisharp-vscode的 GitHub 存储库中将票作为一个错误提出,以便快速解决。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章