asp.net core environment-practical skills under cloud server

Source: Internet
Author: User

Recently. NET core in full swing, the domestic environment in this area of the document is also very many, but many are already outdated, even if the process to go down to avoid some places have long been different. So I will teach you from beginning to end to build an environment, and successfully run the official website demo.

I. SYSTEM environment

This time the author because of lazy to do virtual machine, so registered a cloud provider's trial account as this time the host.

System: Ubuntu Server 14.04.2 LTS 64bit

Mono:1.0.0-rc1-update1

Coreclr:1.0.0-rc1-update1

Two. Text

1. First of all, we first install the mono environment

1.1 We enter at the console first:

The contents are as follows:

Copy Code code as follows:
sudo apt-key adv--keyserver hkp://keyserver.ubuntu.com:80--recv-keys 3fa7e0328081bff6a14da29aa6a19b38d3d831ef

1.2 Then continue typing:

The contents are as follows:

Copy Code code as follows:
echo "Deb Http://download.mono-project.com/repo/debian wheezy main" | sudo tee/etc/apt/sources.list.d/mono-xamarin.list

1.3 Continue to install:

The contents are as follows:

Copy Code code as follows:
sudo apt-get update

1.4 The final step is to start the formal download mono and installed, time-consuming will be longer

The contents are as follows:

Copy Code code as follows:
sudo apt-get install Mono-complete

1.5 After completing the steps above to confirm that the installation is successful and the version is correct, we need to enter the following instructions to view

Notice here, after the reader is installed, please see the version number, your version number should be the same as me or higher than me, if the installation will be lower than my later problems, so it is important to confirm the installation of the correct version of the mono.

2. Installation. NET version control (DNVM)

The contents are as follows:

Copy Code code as follows:
Curl-ssl https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.sh | Dnx_branch=dev sh && Source ~/.dnx/dnvm/dnvm.sh

3. Install Dnx

DNX is the net operating environment, currently provides mono and. NET core two ways, the author will install two, and use these two environments to run our program.

3.1 Installation DNX must tools

The contents are as follows:

Copy Code code as follows:
sudo apt-get install Libunwind8 gettext libssl-dev libcurl4-openssl-dev zlib1g libicu-dev Uuid-dev

3.2 Install DNX for. NET Core

You can see that the version we are currently downloading is 1.0.0-rc1-update1.

The contents are as follows:

Copy Code code as follows:
DNVM Upgrade-r CORECLR

3.3 Install Dnx for mono

We just installed the mono, but did not install the DNX corresponding Mono SDK.

The contents are as follows:

Copy Code code as follows:
DNVM Upgrade-r Mono

3.4 Verify the DNX we installed

Below we use the following instructions to view some versions of our currently installed DNX

You can see that we have installed the corresponding version of the mono implementation and CORECLR implementation, so you must understand the DNVM, Dnx, mono and coreclr relationship.

3.5 Installation Libuv

This is a library that must be installed to run the Web. The relevant commands are as follows, the author will not be a screenshot.

Copy Code code as follows:
sudo apt-get install make automake libtool Curlcurl-ssl https://github.com/libuv/libuv/archive/v1.8.0.tar.gz | sudo tar zxfv--c/usr/local/srccd/usr/local/src/libuv-1.8.0sudo sh autogen.shsudo./configuresudo makesudo Make Install sudo rm-rf/usr/local/src/libuv-1.8.0 && cd ~/sudo ldconfig

4. Run the official example

4.1 To be able to download the official website example, so we need to install Git first

After the installation is complete, we download the example from the network to local

Then we switch to the corresponding directory, on the author's machine through the following instructions can go to the corresponding version of the instance

After switching to the directory through LS we can see which of the following are the examples:

The official default provides the console, asp.net 5 and asp.net mvc 63 examples.

4.2 Running the console sample using mono and CORECLR

First we switch to the directory:

Then restore the library referenced below:

The specific installation time depends on the reader's network environment, if the display of the following interface to indicate the success of the installation:

Then we can use the DNX to run:

The correct output.

Now we'll switch DNX to CORECLR to run the program:

Successfully switched, we run directly below:

The content is also successfully exported.

4.3 running MVC using mono and CORECLR

First of all we need to switch to the corresponding directory, remember that our current DNX is coreclr:

To recover a referenced library:

This may take a long time, because there are more references cubby. Continue to be the successful interface for installation:

This operation is not DNX run, if you want to try to run, the last mistake I believe readers can understand, here we need to use other instructions to run (DNX Web):

We succeeded in seeing the final effect, and we switched to mono to run it once.

Last Run is still dnx Web

Reference:

http://druss.co/2015/03/vnext-install-asp-net-5-dnx-on-ubuntu/

Https://docs.asp.net/en/latest/getting-started/installing-on-linux.html

Https://github.com/dotnet/coreclr/blob/master/Documentation/install/get-dotnetcore-dnx-linux.md

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.