Skip to content

A simple guide on how to install Visual Studio Code on Arch-Linux or Arch-based systems, and set it up to work with C# and Code-Runner

Notifications You must be signed in to change notification settings

000Daniel/How-to-install-Visual-Studio-Code-on-Arch-linux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

How to install Visual Studio Code on Arch-linux

vscode_logo

Note before installing

    This guide uses: sudo, git, pacman, and the Arch/AUR repositories.
    The mentioned later script was tested only on EndeavourOS(Arch-based)
    I do not take any responsibility for any kind of damage this guide or script might cause,
    use them at your own risk.


Auto-Install

 download the auto-Installer-Visual-Studio-Code.sh file.
    🞄 Note: if you have multiple users on your system edit the script and
    🞄      in userName=* replace the * with your preferred user's name.
    now enter the next commands into the terminal:
    sudo chmod +x auto-Installer-Visual-Studio-Code.sh
    sudo pacman -Syu
    ./auto-Installer-Visual-Studio-Code.sh
    🞄 the script will ask you multiple times to confirm the installations.
    🞄 after the script finishes follow the Manual-Install (set-up C# and Code-Runner)

Manual-Install

    enter the next command into the terminal: sudo pacman -Syu
    now enter the next commands:
    sudo pacman -S dotnet-sdk git gcc-libs glibc gnupg gtk3 libnotify libsecret libxss lsof nss shared-mime-info xdg-utils glib2
    to verify that the installation of the framework worked, type:
    dotnet --version
    now we'll install the software itself:
    cd Downloads/
    git clone https://AUR.archlinux.org/visual-studio-code-bin.git
    cd visual-studio-code-bin/
    makepkg
    sudo pacman -U visual-studio-code-bin-*
    cd ..
    rm -rf visual-studio-code-bin/
    🞄 now you can start Visual Studio Code.

Manual-Install (set-up C# and Code-Runner)

    If you need to setup C#(CSharp) and Code-Runner on VSCode here's how:
    in VSCode go to Extensions

image

    and install the C# and code runner extensions
    now go to FilePreferencesSettings
    search run in terminal and enable Code-runner: Run In Terminal

image

    🞄 if you followed the Auto-Install section you can skip this step with Code-Runner.
    click on the open settings icon top right

image

    write code-runner.executorMap and press enter.
    the script should automatically update and look like this:

image

    scroll down to csharp and instead of scripts write:
    cd $dir && sudo dotnet run $fileName

image
    save the file.

Set-up a C# project

    open in FileOpen Folder... your chosen work directory
    then go to TerminalNew Terminal
    🞄 to create a C# console application run the next command:
    dotnet new console
    🞄 then to be able to save your project, run:
    sudo chmod +x Program.cs

    🞄 hopefully this guide covered everything that you needed, and I hope that everything worked!
    🞄 now you should be able to run your C# projects with the 'Code-Runner' extension and save properly!
    🞄 happy coding!




- created by https://github.com/000Daniel

Publish/Release dates: 06.01.2022