Ionide-vscode-fsharp: Debugging .NET core projects

Created on 17 Feb 2017  路  27Comments  路  Source: ionide/ionide-vscode-fsharp

Debugging of .net core console app (netcoreapp1.0, netcoreapp1.1) works inside VS Code

Using the new fsproj.

Like c# with csproj now using c# extension or ominisharp

  • [x] F5 run in debug
  • [x] create launch.json with doesnt exists
  • [x] breakpoints
  • [x] watch
  • [x] stack trace

TODO

  • [x] compiler emit pdb in portable pdb format
  • [x] vscode debugging engine recognize f# console and pdb
enhancement

All 27 comments

馃憤 馃槏

What about netcoreapp1.1?

@xperiandri yes, that too. is the same. It's just i copy/pasted an old issue (before 1.1 :D)

Added https://github.com/OmniSharp/omnisharp-vscode/issues/1257 to ask debugger team more info.
atm with rc4 and FSharp.NET.Sdk 1.0.0 debugging sort of work (but no breakpoints) without hacks

image

Now i think should be ok to start thinking seriously about this issue because:

  • msbuild/sdk is ok and stable
  • fsproj works
  • portable pdb are generated by latest version of fsc compiler
  • fsharp.core should be ok too
  • basic debugger works (debug a program with failwith to see)

I don't know why but it does not work at all. And even F# language service does not appear in output.
How can I diagnose the issue?

it's doesnt matter the f# intellisense i think (it doesnt work yet).
try:

  • create rc4 c# console
  • debug it correctly, so we are sure things works
  • clone my repro (see other pr) and follow instruction in readme

I can't set a breakpoint and statement completion (IntelliSense) does not work to.
But if I run it within debugger and got exception it appears in editor.
Is it a right behavior for now?

I can't set a breakpoint and statement completion (IntelliSense) does not work to.
But if I run it within debugger and got exception it appears in editor.

yes @xperiandri , that's the current status, please read https://github.com/OmniSharp/omnisharp-vscode/issues/1257

OK, so this means there is nothing related to Ionide, just an issue with .NET Core debugging in VS Code, right?

I don't know who should enable breakpoints. Maybe ionide need to do that by api. Or not.
This issue is there as high level feature request. The other is asking more info directly to the team ppl redirected me to

Neither extension (Ionide or omnisharp) doesn't define that you can use breakpoints on F# files in their project.jsons. Maybe adding it to omnisharp would be enough. Dirty workaround (used also for Fable, and source-map based debugging) is to install mono-debugger - this will let you put breakpoints in F# files.

I still think that they should release debugger as separate extension just like mono-debugger

Indeed! Mono debugger allows to put break points.
Statement completion left...

@Krzysztof-Cieslak can you comment about that in the linked issue? Maybe they can do something about that (enable by default in coreclr debugger).

@xperiandri I'll fix intellisense soon, np about that

I think mono-debugger is only an option on non Windows?

@richardjharding i tried it, addign mono-debugger works also on windows

@Krzysztof-Cieslak good catch. is this a good summary?

  • omnisharp add build/run/debug of .net core (that should be moved to a single package agreed)
  • if adding mono-debugger enable F# breakpoint and enable breakpoint on coreclr debugger too (step/continue works), so is just a flag set by mono-debugger extension ihmo for f#, because c# works without mono-debugger.

I'll try to check to see what's doing (no promises, not familiar with vscode extension codebases), so maybe we can add that in ionide and call it a day

maybe I was looking at the wrong thing - not Mono Debug vscode extension?

I have a combined c# (specflow) f# project (canopy steps) solution that I would like to use vscode for so getting debugging working is the final piece

I think mono-debugger is only an option on non Windows?

Debugging by mono-debugger works only on Linux / OSX. But mono-debugger extension manifest enables setting breakpoints in F# files.

That's what is needed: https://github.com/Microsoft/vscode-mono-debug/blob/master/package.json#L46-L54.

I'll add it one day here anyway, when Full .Net debugger is ready

@Krzysztof-Cieslak maybe is easier.

Checking source code, mono-debugger enable breakpoints checking the filename extension

related, also unity debugger work like mono-debugger but doesnt enable f# extensions

i just cannot find code for coreclr debugger, to check that

ah manifest too, @Krzysztof-Cieslak the omnisharp for debuggers is a bit different too (as a note) but maybe that's the dropdown for choosing debugger.
Enabling fsharp in package.json should at least do it for fsharp editors, let's see

Ok works. enable breakpoint without mono-debugger. thx a lot @Krzysztof-Cieslak

I'll send pr later today.

debug-breakpoints

just f# expression eval is missing. atm is c# expression based, but that's the debug engine afaik /cc @cartermp @mrward for more info in VS and VS on mac

Debugging for F# .NET Core projects works in Visual Studio for Mac. It was not working in the last preview that was released preview 3. Not done a huge amount of testing. @nosami has been looking at some things I got stuck with that were not working with F# .NET Core projects in Visual Studio for Mac.

@mrward no i mean, in vs on mac the debug eval (watch) of F# expression works? in vscode the expression of eval are c# based. just trying to figure if is something of engine or client

the old beore FSharp.NET.SDk 1.0.0 (the dotnet-compile-fsc) used an old compiler, so probably portablepdb were not ok. the 1.0.0 use latest released fsc
I'll push tomorrow a fix for that mono issue (if this is what stuck you). i was waiting some review (i'll ping ppl another time)

Visual Studio for Mac passes the watch expression to the .NET Core debugger for evaluation.

OK, closing this one. Debugger is working with Omnisharp, we can't fix evaluator on our own (and there's issue on this in VF# repo)

What about statement completion? Is it tracked in another issue?

@xperiandri the what? intellisense?

Yes

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cloudRoutine picture cloudRoutine  路  5Comments

MangelMaxime picture MangelMaxime  路  4Comments

gsomix picture gsomix  路  6Comments

cartermp picture cartermp  路  4Comments

isaacabraham picture isaacabraham  路  3Comments