Debug C# and F# together in VS Code
Read the guide: Debug C# and F# together
Transcript
Start in C#, step into F#, and come back. One debugging session in VS Code.
Install SharpLsp from the VS Code Marketplace: free C# and F# tooling.
Subscribe for .NET, C# and F# content.
This C# console app references an F# library. Build the sample, then open Program.cs.
Put a breakpoint on the pricing call with F9. Press F5 to launch our checkout configuration.
The yellow line is the next statement to execute. The pricing call has not run yet.
Variables shows quantity three and unit price twenty. Expand Locals to inspect the current frame.
Add quantity times unitPrice to Watch. The result is sixty, before we step into the calculation.
Step Into with F11. The debugger opens the F# source at calculateTotal.
The call stack still includes our C# caller. This is the same process and the same debugging session.
Use F10 to step over each statement. The subtotal becomes sixty, and the discount is five.
Step again. The F# total is fifty-five. Watch the values beside the highlighted execution line.
Step Out returns to C#. Advance past the assignment if needed, then inspect total: fifty-five.
Continue with F5. The Debug Console prints Total: 55, and the program finishes.
Breakpoint in C#, inspect and watch, step into F#, then return and continue. One session, both languages.
Install SharpLsp, and subscribe for .NET, C# and F# content!