Win10 and Ubuntu demo running. NET Core RC2 1.0.0.3002702 program

Source: Internet
Author: User
Tags dotnet using git

As the. NET core RC2 (1.0.0.002702) is released, let's play with Ubuntu locally win10.

First, the. NET core, used in. NET core RC1, is the DNX toolchain for reference http://www.cnblogs.com/shanyou/p/4589930.html,. NET Core RC2 in the full use of dotnet tool chain instead, specific instructions see

    • dotnet NEW: Initializing a console C # project

    • dotnet Restore: Recovering a dependency package for a project

    • Dotnet Build: Building a. NET core application

    • dotnet Publish: Publish a portable or self-contained application

    • Dotnet Run: Running the application from the source code

    • dotnet test: Use Test runner to run the testing case

    • Dotnet Pack: Create a NuGet package for your application

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

The first step is to install the. NET Core SDK Https://www.microsoft.com/net/download in win10 and download the appropriate SDK based on the number of your system bits, my 64-bit

After downloading, the idiot installed

This will be in addition to the deletion after installation is complete.

Open the command line below dotnet info to see the following information version

OK when the SDK is installed, the program output of the console with the dotnet CLI is executed as follows.

    1. mkdir Hwapp//Create a directory
    2. CD Hwapp//Open Directory
    3. dotnet New//initialization of a console program
    4. dotnet Restore//downloads the required dependency packages and generates Project.lock.json
    5. Dotnet Run//runs. NET Core

The 5th step executes the result, and the console outputs Hello world.

Next, run an ASP. NET core MVC program, download the example https://github.com/aspnet/cli-samples below, or download it using Git.

If you enter the \CLI-SAMPLES-MASTER\HELLOMVC directory and then perform the dotnet Restore download Dependency package (which may take a while), then execute the dotnet run Web site

Browser opens Http://localhost:5000/

Ubuntu under Deployment MVC mode one

First, under WIN10, the MVC directory \CLI-SAMPLES-MASTER\HELLOMVC open cmd input dotnet Publish command line to publish the MVC default release \LI-SAMPLES-MASTER\HELLOMVC Under the \bin\debug\netcoreapp1.0\publish.

Then copy this directory directly to Ubuntu as I var\local\ under the test.

Run directly

dotnet HelloMvc.dll//Note case.

Witness the moment of miracles, completely out of mono other third parties, and this way without the. NET Core SDK.

Mode 2 Install the. NET Core SDK reference official address Https://www.microsoft.com/net/core#ubuntu is to execute some scripts as follows, this way is a global installation method, so that can be directly developed in Ubuntu, such as vs Code.

After downloading the. NET Core SDK, execute the following command to enter your Ubuntu directory \CLI-SAMPLES-MASTER\HELLOMVC directory

Perform a dotnet restore download dependency package.

Execute dotnet run. NET core MVC

Communicate with each other and make progress together.

Win10 and Ubuntu demo running. NET Core RC2 1.0.0.3002702 program

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.