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)