Talk:Visual Studio Code

From ArchWiki
Jump to navigation Jump to search

vsdbg

Has anyone gotten debugging working with code (open-source release)?

The official (AFAIK) debugger vsdbg is not included in the open-source release: https://aka.ms/VSCode-DotNet-DbgLicense

Is it not possible to download vsdbg manually? Eg. https://aka.ms/getvsdbgsh

Aude (talk) 08:27, 8 May 2019 (UTC)

I managed to do it using netcoredbgAUR, though it's not very well documented.
The way I did was by adding this to the default launch configuration for .NET Core:
./.vscode/launch.json
...
"pipeTransport": {
    "pipeCwd": "${workspaceFolder}",
    "pipeProgram": "/usr/bin/bash",
    "pipeArgs": ["-c"],
    "debuggerPath": "/usr/bin/netcoredbg"
}
...
This will trick Code into running netcoredbg instead of vsdbg. From what I understand pipeTransport is used for SSH configurations, but you can use a shell just the same to take advantage of debuggerPath.
Luluco250 (talk) 16:11, 7 September 2019 (UTC)

snap or flatpak installation for Visual Studio Code

snap or flatpak are becoming the preferred method (by Microsoft) for the installation of Visual Studio Code.

There are two versions of Visual Studio Code: open-source OSS has a flatpak, and Microsoft vscode has a snap package.

For VSCode see https://snapcraft.io/code see below on how to install snap.

For OSS see https://flathub.org/apps/details/com.visualstudio.code.oss

Installation of Flatpak: Make sure to follow the setup guide before installing

$ sudo pacman --noconfirm --needed -S flatpak
$ flatpak install flathub com.visualstudio.code.oss

Run:

$ flatpak run com.visualstudio.code.oss

snap is currently only in AUR, to install from AUR you need a utility like yay, to install it:

$ sudo pacman --noconfirm --needed -S yay

snap has a stable release

$ yay --noconfirm --needed -S snapd

or the git release that may be newer

$ yay --noconfirm --needed -S snapd-git

To get it to run using AppArmor

$ sudo systemctl enable --now apparmor.service

To get it to automatically update snap packages

$ sudo systemctl enable --now snapd.apparmor.service
$ sudo snap find vscode
Name               Version   Publisher   Notes    Summary
code               8795a988  vscode✓     classic  Code editing. Redefined.
code-insiders      a747d264  vscode✓     classic  Code editing. Redefined.

To install Visual Studio Code

$ sudo snap install code --classic

or to install Visual Studio Code Insiders

$ sudo snap install code-insiders --classic

Flesh (talk) 18:49, 27 November 2019 (UTC)

Update: AUR flag for Visual Studio Code Insiders is wrong because the package is self updating.
Dcelasun (talk)

No need for manual installation of MSBuild, and adding a troubleshooting entry on ignoring Mono

.NET Core should ship with its own version of MSBuild. Right now, the AUR msbuild-stable package is quite out-of-date and on version 16.0, while the one that comes with .NET Core is version 16.4. I never had to install another version of MSBuild, and when I did it didn't use it. I think there's some way of manually specifying the MSBuild verison, but I couldn't find a good resource detailing how to do that.

For this reason I think it's reasonable to remove the section talking about a missing MSBuild, titled "Error from OmniSharp that MSBuild cannot be located"?

Also, (possibly when Mono is installed as well as .NET Core SDK,) everything in VSCode is unrecognised when debugging C# (and possibly the other .NET languages, Visual Basic and F#) , things like 'System' not found. The solution to this is to tell Omnisharp to ignore Mono, as detailed in this GitHub issue. This would be useful to add on to the troubleshooting section. TheSheepGuy (talk) 08:21, 7 June 2020 (UTC)