Install DotNet Core SDK 2.2 For Ubuntu 16.04

Ref: https://dotnet.microsoft.com/download/linux-package-manager/ubuntu16-04/sdk-current

Register Microsoft key and feed
Before installing .NET, you’ll need to register the Microsoft key, register the product repository, and install required dependencies. This only needs to be done once per machine.

Open a terminal and run the following commands:

Install the .NET SDK
Update the products available for installation, then install the .NET SDK.

In your terminal, run the following commands:

OK. Check the dotnet version (dotnet –version) or more complete info (dotnet –info):

 

Create First DotNet App
ref: https://dotnet.microsoft.com/learn/dotnet/hello-world-tutorial/create

The dotnet command creates a new application of type console for you. The -o parameter creates a directory named myFirstApp where your app is stored, and populates it with the required files. The cd myFirstApp command puts you into the newly created app directory.

The main file in the myFirstApp folder is Program.cs. By default, it already contains the necessary code to write “Hello World!” to the Console.

Run your app
In your terminal, run the following command:

Congratulations, you’ve built and run your first .NET app!

Edit your code
Open Program.cs in any text editor (e.g. Notepad) and add a new line of code below the one that prints “Hello World!”, like the following:

Save the Program.cs file, and run your code again.

Create First ASP.Net App
ref: https://dotnet.microsoft.com/learn/web/aspnet-hello-world-tutorial/create
Create your app
In your terminal, run the following commands:

Run your app
In your terminal, run the following command:

Then open it on your web browser: http://localhost:5000/Edit your code
Open Pages/Index.cshtml in any text editor and replace all of the code with the following:

Save the file then refresh the browser to see the change:

Leave a Reply

Your email address will not be published. Required fields are marked *