我正在使用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/