I am using http trigger Azure Function. When I am running my application (by pressing F5), after clicking http://localhost:7071/api/HttpTrigger1
, I am getting response in browser but code doesn't stop at breakpoints.
经过仔细观察,我看到调试器启动了0.5秒,然后自动关闭。
我已经发布了视频here https://youtu.be/Z6hQ6B92bzA。在第 5 秒,我们可以看到调试器启动但立即关闭(第 5 秒为橙色屏幕)。
有一个Stackoverflow 上有类似问题 https://stackoverflow.com/questions/70030531/not-able-to-debug-azure-functions-in-visual-studio-code,但这并没有解决我的问题。
我在 Mac 上的 VS Code 中调试 Azure Functions 时也经历过同样的情况。我在 Omnisharp GitHub 上发现了关于此问题的未决问题:
https://github.com/OmniSharp/omnisharp-vscode/issues/4903 https://github.com/OmniSharp/omnisharp-vscode/issues/4903
最后,basilfx 的解决方法帮助了我:
我被上面日志中有关代码签名的日志行触发。因此我尝试了以下方法:
- 创建自签名代码签名证书:https://stackoverflow.com/a/58363510/1423623 https://stackoverflow.com/a/58363510/1423623
- 导航到调试器文件夹(在我的例子中,〜/.vscode/extensions/ms-dotnettools.csharp-1.24.4-darwin-x64/.debugger/x86_64)
- 运行 codesign --remove-signature vsdbg-ui && codesign --remove-signature vsdbg
- 运行 codesign -s my-codesign-cert vsdbg-ui && codesign -s my-codesign-cert vsdbg
我现在可以从 VS Code 附加到在断点处停止的 ./vsdbg-ui --server --consoleLogging --engineLogging 的运行实例。这是一种解决方法,但它表明 vsdbg 和/或 vsdbg-ui 的代码签名存在问题。
2022-04-20:可以确认这仍然有效,使用 OmniSharp 1.24.4。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)