8 dotnet on Ubuntu
Colin McMillen edited this page 11 months ago

One-time setup

https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu

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
sudo apt update
sudo apt install dotnet-sdk-5.0

Create and run a sample Hello World project:

dotnet new console -o hello
cd hello
dotnet build
dotnet run

More documentation on dotnet new: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-new

Stuff specific to MonoGame

https://docs.monogame.net/articles/getting_started/1_setting_up_your_development_environment_ubuntu.html

sudo apt install dotnet-sdk-3.1
dotnet new --install MonoGame.Templates.CSharp
dotnet tool install --global dotnet-mgcb-editor
mgcb-editor --register
dotnet build DesktopGL/DesktopGL.csproj
dotnet run --project DesktopGL/DesktopGL.csproj

Publishing a Linux executable from Windows

dotnet publish -c Release -o mygame --self-contained --runtime linux-x64