DotNet Core Tour (i)

Source: Internet
Author: User
Tags dotnet

1. Download and install Dotnetcore.1.0.0-sdk.preview2-x64.exe

Download Link: https://www.microsoft.com/net/download

PS: If you have vs2015, directly "expand and update" inside the installation is OK

2. Execute the following command:

New project folder >mkdir MyProject

Go to project folder >CD MyProject

Initialize a hellow Word program > dotnet New

Results:

Congratulations, your project initialization is complete, you can go to the folder to see the directory structure as follows (only two files Program.cs and Program.json):

PS: If you do not have Visual Studio, we recommend that you use Visual Studio code (a cross-platform compiler)

The Program.cs code is as follows:

using System; namespace consoleapplication{    publicclass  program    {        public Static void Main (string[] args)        {            Console.WriteLine ("Hello world! " );        }    }}

The above code can be modified

The Program.js code is as follows:

{  "version":"1.0.0-*",  "buildoptions": {    "Debugtype":"Portable",    "Emitentrypoint":true  },  "Dependencies": {},  "Frameworks": {    "netcoreapp1.0": {      "Dependencies": {        "Microsoft.NETCore.App": {          "type":"Platform",          "version":"1.0.0"        }      },      "Imports":"Dnxcore50"    }  }}

3. Download the package specified in the JSON file

Execute the donet restore command under the project file

The project folder directory structure is as follows:

Project.lock.json will see the project-dependent package

4. Running the project

Execute the dotnet Run command under the project folder

A simple Hello world is done, clap for yourself ~

(The main purpose of this article is to guide some beginners, let you quickly create a dotnet core project, if there is a problem, please leave a message, thank you for your support)

For Linux and Mac, click Https://www.microsoft.com/net/core (This article is also referenced with this article)

DotNet Core Tour (i)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.