Developer Docs

C#Bot Setting Up Your Development Environment: Linux

This article will guide you through the installation of C#Bot’s core prerequisite dependencies, which should take approximately 5-10 minutes. These are the core dependencies you will be installing:

.NET 5 SDK

.Net Core SDK is a software development kit for building and developing C# applications (like those written by C#Bot).

Make sure you download .Net 5 and not .Net 6, as the bot has not been upgraded yet.

To install the .Net 5 SDK:

  1. Go to Microsoft .Net Core Download
  2. Using the in-article menu on the right side of the page, navigate down to your Linux distribution (i.e. Ubuntu)
  3. Choose the version of your distribution (i.e. 21.10)
  4. Follow the instructions provided for the version that you are linked to

Node.js

In this section, nodejs, npm and nvm will be installed. Node.js is an open-source and cross-platform Javascript runtime environment built on Chrome’s V8 Javascript engine to build fast and scalable network applications. Node uses npm (nodejs package manager) as the default package manager to make it easy to download npm packages. Node Version Manager (nvm) is a helpful bash script that is used for managing numerous versions of active Node js.

Installing Node.js, npm or nvm on linux is easily done with one command from bash terminal.

  1. Open the bash terminal. Run the following command to update the packages index:

     sudo apt update
    
  2. Install node and other supporting packages by running the following command:

     sudo apt install nodejs npm curl
    
  3. Verify that the installations worked by running the following command:

     nodejs --version
      npm --version
    
  4. Update node to version 14.16.0.

     sudo npm install -g n
      sudo n 14.16.0
    
  5. Install nvm. The curl command is used for nvm installation.

     curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
    
  6. Close and re-open the bash terminal, and verify that the nvm installation worked.

     nvm --version
    
  7. Change your active Node version to 14.16.0

     nvm use 14.16.0
    

PostgreSQL

Installing PostgreSQL

PostgresSQL 10 can be installed by using the following command in the linux terminal:

sudo apt-get install postgresql-10

PostgreSQL should now be installed on your machine.

Setting 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 C#Bot (under the First Time Setup steps) for reconfiguring the database connection string to suit pre-existing PostgreSQL user configuration.

Open Terminal and execute the following commands:

sudo -u postgres psql postgres
\password postgres

You’ll see:

Enter new password: 
Enter it again:

Enter pass to set the password to ‘pass’.

pgAdmin

pgAdmin is a useful database explorer that works with PostgreSQL. It comes installed with postgreSQL in the enterprisedb package which was installed in the above section.

To access pgAdmin, search your applications list for ‘pgAdmin’. pgAdmin is a browser-based application and will launch in your web browser. You can use this tool to modify database tables and configurations.

pgAdminImage

dotnet -ef

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.

To install it, open bash and run the following command:

dotnet tool install --global dotnet-ef --version 5.0

You can verify the installation by running the command below:

dotnet-ef -v

Was this article helpful?

Thanks for your feedback!

If you would like to tell us more, please click on the link below to send us a message with more details.

Tool:

Generate

Iterate

Bot:

C#Bot

SpringBot

On this page

New to Codebots?

We know our software can be complicated, so we are always happy to have a chat if you have any questions.