Visual Studio and .NET for Linux

Hello everyone.
I’m having a blast with this course, but I use Linux and this is to help get Visual Studio working on Linux.
I use Linux Arch and after installing Unity 3D you will need to download Visual Studio Code.
If you are using Linux, then you should know how to download.
Download Visual Studio Code NOT Windows Visual Studio.

If you have successfully downloaded and Linux will automatically install it, when you double click the .cs file inside Unity and Visual Studio Code opens up, you may get a message that it needs .NET installed.
Now. as I use Linux Arch I just needed to install dotnet-runtime and dotnet-sdk
If you are using other Linux distributions, such as Ubuntu, Debian, SuSE then follow these instructions.
.NET core 3.1 Ubuntu 20.04 -

wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb

Install the SDK

.NET Core SDK allows you to develop apps with .NET Core. If you install .NET Core SDK, you don’t need to install the corresponding runtime. To install .NET Core SDK, run the following commands:

sudo apt-get update; \
  sudo apt-get install -y apt-transport-https && \
  sudo apt-get update && \
  sudo apt-get install -y dotnet-sdk-3.1

Install the runtime
The .NET Core Runtime allows you to run apps that were made with .NET Core that didn’t include the runtime. The commands below install the ASP.NET Core Runtime, which is the most compatible runtime for .NET Core. In your terminal, run the following commands.

sudo apt-get update; \
  sudo apt-get install -y apt-transport-https && \
  sudo apt-get update && \
  sudo apt-get install -y aspnetcore-runtime-3.1

As an alternative to the ASP.NET Core Runtime, you can install the .NET Core Runtime that doesn’t include ASP.NET Core support: replace aspnetcore-runtime-3.1 in the command above with dotnet-runtime-3.1 .

sudo apt-get install -y dotnet-runtime-3.1

If you get errors then see APT troubleshooting -

For Ubuntu 19.10 change 20.04 to 19.10 in the wget htpps://…

For Debian 10 it’s

wget https://packages.microsoft.com/config/debian/10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb

then the rest of the commands in Ubuntu are the same.
Debian 9 is a little different

wget -O - https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg
sudo mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/
wget https://packages.microsoft.com/config/debian/9/prod.list
sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list
sudo chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg
sudo chown root:root /etc/apt/sources.list.d/microsoft-prod.list

the rest of the code install is the same as Ubuntu.

OpenSuse as far as I know only 15 will work.

sudo zypper install libicu
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
wget https://packages.microsoft.com/config/opensuse/15/prod.repo
sudo mv prod.repo /etc/zypp/repos.d/microsoft-prod.repo
sudo chown root:root /etc/zypp/repos.d/microsoft-prod.repo

Install SDK

sudo zypper install dotnet-sdk-3.1

Install runtime

sudo zypper install aspnetcore-runtime-3.1

Alternative to ASP.NET Core Runtime

sudo zypper install dotnet-runtime-3.1

I hope that helps.
Probably not many people are using Linux for Unity 3D and Visual Studio, but just in-case you are…
Have fun!