muhammadsammy / free-vscode-csharp

Free/Libre fork of the official C# extension for vscode

Home Page:https://open-vsx.org/extension/muhammad-sammy/csharp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

v2.0: "undefined" is not valid json in

Dreamoochy opened this issue · comments

VSCodium 1.82.1 with free-omnisharp 2.0.436. When I try to debug (F5) I get the following notification:

"undefined" is not valid JSON

Debug is not started. With free-omnisharp 1.25.7 everything is OK.

P.S. Portable VSCodium, portable .NET SDK (7.0.400)

I had the same problem with VSCodium and dotnet 6.0 installed via the package manager on Debian. But it didn't recognize dotnet 6.0 and downloaded a portable version of 7.0 to use.

Having the same issue with code - OSS on Manjaro, .NET SDK 7.0.111
Help > Toggle Developer tools:
image

A workaround for this seems to be adding "csharp.debug": {}, to your settings

A workaround from @yelvert didn't work for me unfortunately, at least not with the recent 2.7.25 and 2.0.436 versions.

However I found a reason why it fails and a temporary solution until the proper fix is merged.

Extension starts a debugger using the command defined here:
https://github.com/muhammadsammy/free-omnisharp-vscode/blob/master/src/coreclrDebug/activate.ts#L286-L291

So on Linux system it ends up with the command looking like:
~/code-server/Extensions/muhammad-sammy.csharp-2.7.25-universal/.debugger/netcoredbg while netcoredbg is installed to the path ~/code-server/Extensions/muhammad-sammy.csharp-2.7.25-universal/.debugger/netcoredbg/netcoredbg. So the workaround is to move all files from netcoredbg directory one level up directly to .debugger directory.

It looks like the installation path is taken from installTestPath defined in https://github.com/muhammadsammy/free-omnisharp-vscode/blob/master/package.json#L489-L505. I think the proper fix could just modify the command path mentioned above to that value.

Thank you @mars-low.
That workaround works.

Added this workaround in v2.8.23.
Thanks @mars-low!

Added this workaround in v2.8.23.

v2.8.23 on Win10 now looks like it does nothing. When I press F5, build process is started, and then nothing happens. It doesn't stop at breakpoints. And I don't see any error notification.