Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure functions: how to debug csx in VS Code

I'm trying to debug an Azure function (CSX) on localhost in Visual Studio Code. I can attach a debugger, but I cannot put a breakpoint. Should I install something?

like image 377
Piotr Stapp Avatar asked Aug 17 '17 21:08

Piotr Stapp


2 Answers

Currently, Functions CSX debugging in VS Code is not supported. VS Code debugging does not support full/desktop CLR, which is what CSX functions target.

like image 163
Fabio Cavalcante Avatar answered Sep 17 '22 15:09

Fabio Cavalcante


Debugging csx files has been solved since the original answer.

This blog gives a broad tutorial including debugging.

The key is

dotnet script init

Which will set up the launch.json and omnisharp.json files needed. This config will debug whatever script file is open.

TIP: You may want to change stopAtEntry in launch.json to false. This setting confused me at first because it causes the program to halt before any breakpoint is reached, and seemingly before the script file is reached.

like image 39
farlee2121 Avatar answered Sep 20 '22 15:09

farlee2121