Archive

Archive for July, 2017

[manjaro] Make C# debugger work in Visual Studio Code

Problem
Under Manjaro / Arch you use Visual Studio Code with the C# extension. Everything works fine except the C# debugger.

Solution
I found the solution here: https://github.com/OmniSharp/omnisharp-vscode/issues/1323 . The debugger on Manjaro / Arch is not supported officially, so we need to do some tricks. In VS Code open the user settings and add this line:

"csharp.fallbackDebuggerLinuxRuntimeId": "ubuntu.16.04-x64"

Uninstall the C# extension, restart VS Code, and re-install the C# extension. Open a .cs file and the extension will download some packages, including the debugger for Ubuntu 16.04 (as we specified it in the settings).

However, the *.so files of the Ubuntu debugger rely on a specific version of the package “icu”.

$ cd ~/.vscode/extensions/ms-vscode.csharp-1.11.0/.debugger
$ find *.so -type f | xargs ldd 2> /dev/null | grep not\ found
        liblldb-3.6.so => not found
        libvsdebugeng.so => not found
        libvsbaseservices.so => not found
        libvsbaseservices.so => not found
        libicuuc.so.55 => not found
        libicui18n.so.55 => not found

The last 2 lines are interesting: we need version 55 of the package “icu“. “yaourt icu” revealed that I had version 59 installed, but version 55 can be installed too with “yaourt icu55“. The two versions can co-exist. When installed, restart VS Code and debugging should work now.

Credits
The solution was found at https://github.com/OmniSharp/omnisharp-vscode/issues/1323 . A big thanks for starquake.

Categories: csharp, manjaro Tags:

In C#, ++c and c += 1 are not always equivalent

July 2, 2017 1 comment
csharp> char c = 'a'
csharp> ++c
'b'
csharp> c += 1
(1,7): error CS0031: Constant value `1' cannot be converted to a `char'
csharp>
Categories: csharp Tags: ,