Quantcast
Channel: CodeSection,代码区,Linux操作系统:Ubuntu_Centos_Debian - CodeSec
Viewing all articles
Browse latest Browse all 11063

Getting Started with .NET Core On Linux

$
0
0

by Santhakumar Munuswamy

Posted on01 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:

Understanding the .NET Core in Windows Let’sstartwiththeprerequisites

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

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

VMware

Y oucandownloadtrailversionandinstallVMwarefromthe VMwaresite (or)

Y oucandownloadopensourceandinstallVirtualBoxfromthe VirtualBoxCommunitysite

Ubuntu14.04

Y oucandownloadandinstalltheUbuntuOSfromthe Ubuntusite

.NETCoreSDK

Y oucandownloadandinstallthe.NetCoreSDKasfollowingcommands:

sudoapt-getinstalldotnet-dev-1.0.0-preview2-003131

Let’sstartimplementation

Youareabletoimplement.NETCorewithdifferentmethodssuchasCommandline and VisualStudioCodeEditor .

SettinguptheEnvironment

UsingCommandline,proceduresaregivenbelow:-

I fyouwanttoknowhowtoinstallthe.NETCoreonUbuntu14.4/LinuxMint17,let’sstartwithstep-by-stepguidelines,

OpentheTerminalEmulator CopyandpastthefollowingcommandinTerminal,thenEnter sudo sh-c'echo"deb[arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ trustymain"> /etc/apt/sources.list.d/dotnetdev.list'

sudoapt-keyadv--keyserverapt-mo.trafficmanager.net --recv-keys417A0893


Getting Started with .NET Core On Linux
CopyandpastthefollowingcommandinTerminal,thenEnter

sudoapt-getupdate


Getting Started with .NET Core On Linux
Getting Started with .NET Core On Linux
CopyandpastthefollowingcommandinTerminal,thenEnter

sudoapt-getinstalldotnet-dev-1.0.0-preview2-003131


Getting Started with .NET Core On Linux
Getting Started with .NET Core On Linux

DevelopingaHelloWorldConsoleApplicationonLinux

TypemkdirProjectcdProjectandEnterinthecommandline.
Getting Started with .NET Core On Linux
Getting Started with .NET Core On Linux
TypemkdirConsoleHelloWorldApp,cdConsoleHelloWorldAppandEnterinthe commandline TypedotnetnewandEnterinthecommandline,givenbelow
Getting Started with .NET Core On Linux
Getting Started with .NET Core On Linux
Typedotnetrestoreandenterinthecommandline,givenbelow
Getting Started with .NET Core On Linux
Typedotnetrunandenterinthecommandline,givenbelow
Getting Started with .NET Core On Linux

DevelopingaDisplayCurrentDateTimeConsoleApplicationonLinux

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
Getting Started with .NET Core On Linux

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


Viewing all articles
Browse latest Browse all 11063

Trending Articles