Getting Started with .NET Core On Linux

by Santhakumar Munuswamy

  Posted on  01 October 2016

  .NET Core


 

In this article, we will discuss how we can setup .Net Core on Linux environment, Prerequisite,Developing a console application on Linux , etc.  As we discussed understanding about .NET  Core with hello world application on Windows in my previous articles. If you want to learn .NET Core and its features, you can read the below link:

Let’s start with the prerequisites

You have to download the following software's and install them on your PC

  1. VMware
  2. Ubuntu 14.4 / Linux Mint 17
  3. .NET Core SDK 1.0

VMware 

You can download trail version and install VMware from the VMware site (or)

You can download open source and install Virtual Box from the Virtual Box Community site

Ubuntu 14.04

You can download and install the Ubuntu OS from the Ubuntu site

.NET Core SDK

You can download and install the .Net Core SDK as following commands:

sudo apt-get install dotnet-dev-1.0.0-preview2-003131

Let’s start implementation

You are able to implement .NET Core with different methods such as Command line and Visual Studio Code Editor

Setting up the Environment

Using Command line, procedures are given below:- 

If you want to know how to install the .NET Core on Ubuntu 14.4 / Linux Mint 17, let’s start with step-by-step guidelines,

  • Open the Terminal Emulator
  • Copy and past the following command in Terminal, then Enter

sudo sh -c 'echo "deb [arch=amd64]  https://apt-mo.trafficmanager.net/repos/dotnet-release/  trusty main" >  /etc/apt/sources.list.d/dotnetdev.list'  
sudo apt-key adv --keyserver apt-mo.trafficmanager.net  --recv-keys 417A0893


  • Copy and past the following command in Terminal, then Enter

sudo apt-get update



  • Copy and past the following command in Terminal, then Enter

sudo apt-get install dotnet-dev-1.0.0-preview2-003131



Developing a Hello World Console Application on Linux

  • Type mkdir Project cd Project and Enter in the command line.




  • Type mkdir ConsoleHelloWorldApp, cd ConsoleHelloWorldApp and Enter in the command line
  • Type dotnet new and Enter in the command line, given below




  • Type dotnet restore and enter in the command line, given below


  • Type dotnet run and enter in the command line, given below


Developing a Display Current DateTime Console Application on Linux

  • Open program.cs with gedit 
  • You can implement the get current date time functional and call the function in main method
  • Type dotnet run and enter in the command line, given below


Reference

Conclusion

I hope, you understood setup .Net Core on Linux environment, Prerequisite, Developing a console application on Linux and running it. I have covered all the required things. If you find anything that I missed in this article, please let me know. Please share your valuable feedback or suggestions

 


About the Author
Santhakumar Munuswamy is a seasoned Solution Architect and Most Valuable Professional in Cloud /AI solutions. He has been experienced around 14 years in Solution designing, Software Product Development, Technical Documentation, Project Management for Web and Cloud Applications. He has experience in the IT industry across different domains (Automotive, Telecommunications, Healthcare, Logistics & Warehouse Automation, etc.) with roles in Technical Architect, Genesys Consultant, Technical Lead, Team Lead, and Developer. He has experienced in mentorship and coaching high potential developers.

Follow Me: Facebook, Twitter, Google Plus, LinkedIn
blog comments powered by Disqus


Month List

Community Badges