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.
After careful observation, I saw that debugger starts for 0.5 seconds and closes automatically.
I have posted the video here. At 5th second, we can see that debugger starts but closes instantly (Orange screen at 5th second).
There is a similar question on Stackoverflow, but that didn't solve my problem.
I have experienced the same, while debugging Azure Functions in VS Code on a Mac. I found this open issue on the Omnisharp GitHub about this issue:
https://github.com/OmniSharp/omnisharp-vscode/issues/4903
In the end, basilfx's workaround ended up helping me:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With