azure - 无法在 Visual Studio Code 中调试 Azure Functions。调试器停止

标签 azure visual-studio-code azure-functions visual-studio-debugging

我正在使用http触发器Azure Function。当我运行我的应用程序时(按 F5),单击 http://localhost:7071/api/HttpTrigger1 后,我在浏览器中收到响应,但代码没有t 在断点处停止。

仔细观察,发现调试器启动了0.5秒就自动关闭了。

我已经发布了视频here 。在第 5 秒,我们可以看到调试器启动但立即关闭(第 5 秒为橙色屏幕)。

有一个similar question on Stackoverflow ,但这并没有解决我的问题。

最佳答案

我在 Mac 上的 VS Code 中调试 Azure Functions 时也经历过同样的情况。我在 Omnisharp GitHub 上发现了关于此问题的未决问题:

https://github.com/OmniSharp/omnisharp-vscode/issues/4903

最后,basilfx 的解决方法最终帮助了我:

I was triggered by a log line about code signing in the logging above. I therefore tried the following:

  • Create self-signed code signing certificate: https://stackoverflow.com/a/58363510/1423623
  • Navigate to the debugger folder (in my case, ~/.vscode/extensions/ms-dotnettools.csharp-1.24.4-darwin-x64/.debugger/x86_64)
  • Run codesign --remove-signature vsdbg-ui && codesign --remove-signature vsdbg
  • Run codesign -s my-codesign-cert vsdbg-ui && codesign -s my-codesign-cert vsdbg

I can now attach to a running instance of ./vsdbg-ui --server --consoleLogging --engineLogging from VS Code that stops at breakpoints. It's a work-around, but it shows something is wrong with the code signing of vsdbg and/or vsdbg-ui.

2022-04-20: can confirm that this still works, using OmniSharp 1.24.4.

关于azure - 无法在 Visual Studio Code 中调试 Azure Functions。调试器停止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71187198/

相关文章:

Azure API 管理 - 当 APM 落后于 WAF 时如何获取原始 IP

reactjs - React SPA 中的 msal - 使用从 AcquireTokenRedirect 收到的访问 token

c# - 如何在 C# 中使用 Web HDFS REST API 附加文件?

azure - SQL Azure 导出停留在挂起状态

typescript - 如何隐藏函数参数缺失类型通知?

typescript - 以编程方式调用组织导入并随后保存文件

azure - 构建并发布 Azure 函数以包含 function.json 文件

.net-core - Azure 函数错误 - 无法加载文件或程序集 System.Configuration.ConfigurationManager,版本 = 4.0.3.0

visual-studio-code - 如何摆脱 "Terminal will be reused by tasks, press any key to close it."行为?

c# - Azure 函数中没有 GetQueryNameValuePairs 的定义