C#Bot Setting Up Your Development Environment: Linux
By Mikaela Robertson and Brodie O'Carroll 13 March 2020 Techies
Setting up your C#Bot development environment for Linux
This section will guide you through the installation of C#Bots' core prerequisite dependencies i.e.
- NET Core 3.0 SDk
- Node Js version 12.12.0
- PostgreSQL version 10.6
- dotnet-ef 3.0
The following steps will walk you through the process of setting up your development environment for Linux
Approximate setup time is 5-10 minutes.
.NET Core 3.0 SDK
.Net Core SDK is a Software Development Kit for building and developing C# applications like those written by C#Bot.
To install the .Net Core 3.0 SDK, go to the Microsoft .Net Core Download to download the SDK. You should reach a page that looks like the image below:
Select your linux distribution and follow the instructions outlined on the page.
- Open the bash terminal. Run the following command to update the packages index
sudo apt update
- Install node and other supporting packages by running the following command
sudo apt install nodejs npm curl
- Verify the installations
nodejs --version npm --version
- Update node to version 12.12.0
sudo npm install -g n sudo n 12.12.0
- Install nvm.
curlis used for nvm installation
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
- Close and re-open the bash terminal, and verify the nvm installation
- Change your active Node version to 12.12.0
nvm use 12.12.0
PostgresSQL 10 can be install using one command in the linux terminal.
sudo apt-get install postgresql-10
PostgreSQL should now be installed on your machine.
Set the superuser password
The default password for the PostgreSQL superuser should be set to
pass to allow the Entity Framework Database Connection String to work. If you don't wish to set the superuser password here, there are steps in Running CsharpBot in the
First Time Setup steps for reconfiguring the database connection string to suit pre-existing PostgreSQL user configuration.
Open Terminal and execute the commands:
sudo -u postgres psql postgres \password postgres
Enter new password: Enter it again:
Set the password to
pgAdmin is a useful database explorer that works with PostgreSQL. It comes installed with postgreSQL in the enterprisedb package installed in the above step.
To access, search your applications for
pgAdmin. pgAdmin is a browser application and will launch in your default browser. You can modify database tables and configurations through this tool.
dotnet-ef is a package of Entity Framework Core tools for the .NET command line. It is used to create and apply database migrations after making model changes.
Open bash and run the command.
dotnet tool install --global dotnet-ef --version 3.0
You can verify the installation by running the command below.