Run the. NET Core RC2 1.0.0.3002702 program in Win10 and Ubuntu.

Source: Internet
Author: User

Run the. NET Core RC2 1.0.0.3002702 program in Win10 and Ubuntu.

With the release of. NET Core RC2 (1.0.0.002702), let's try it out on local Windows 10 and Ubuntu.

Let's briefly describe. net core. The dnx tool chain used in. net core rc1 can be referred to. net core rc2 is completely replaced by the dotnet tool chain. For details, see

  • Dotnet new: initialize a console C # project
  • Dotnet restore: restores the dependent packages of a project.
  • Dotnet build: build. NET Core applications
  • Dotnet publish: publish a portable or self-contained Application
  • Dotnet run: run the application from the source code
  • Dotnet test: Use a test runner to run test cases.
  • Dotnet pack: Create a nuget package for the Application

Link: https://blogs.msdn.microsoft.com/dotnet/2016/05/16/announcing-net-core-rc2/

First, install the. net core sdk https://www.microsoft.com/net/download in win10 according to the number of your system to download the corresponding sdk, my is 64-bit such

 

After the download is complete, the installation is complete.

After the installation is complete, add or delete the file.

 

Open the command line and execute dotnet info to check the information version as follows:

 

After the OK sdk is installed, use dotnet cli to set up the console program and output hello world as follows.

  1. Mkdir hwapp // create a directory
  2. Cd hwapp // open the Directory
  3. Dotnet new // initialize a console Program
  4. Dotnet restore // download the required dependent package and generate project. lock. json
  5. Dotnet run // run. net core

 

In step 1, the console outputs hello world.

 

 

Next run a asp.net core mvc program, first download the sample https://github.com/aspnet/cli-samples is as follows, can also be downloaded in git mode.

 

 

For example, go to the \ cli-samples-master \ HelloMvc directory, execute dotnet restore to download the dependency package (it may take a while), and then run dotnet run to run the website.

 

Open http: // localhost: 5000/in the browser/

 

How to deploy mvc in ubuntu

In win10, Run \ cli-samples-master \ HelloMvc In the mvc directory of the above project. Open cmd and enter the dotnet publish command line to publish the \ li-samples-master \ HelloMvc \ bin released by mvc by default. \ Debug \ netcoreapp1.0 \ publish.

Then copy the directory directly to ubuntu, for example, var \ local.

 

Run directly

Dotnet HelloMvc. dll // case sensitive.

 

It's time to witness the miracle, completely away from mono's other third parties.

 

Method 2 install. net core sdk reference official address https://www.microsoft.com/net/core#ubuntu is to execute some scripts as follows, this method belongs to the global installation method, so you can directly develop in ubuntu, such as vs code.

 

After downloading the. net core sdk, run the following command to go to your ubuntu directory \ cli-samples-master \ HelloMvc directory.

Run the dotnet restore command to download the dependency package.

Run dotnet run to run. net core mvc

 

Related Article

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.