Cloud Server under ASP 5 environment (including mono and CORECLR)

Source: Internet
Author: User

Recently, the. NET core is in full swing, the domestic environment in this aspect of the document is also very many, but many are already outdated, even if follow that process will not be able to avoid some places long ago. So below I will teach you to build an environment, and successfully run the official website demo.

I. SYSTEM environment

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

System: Ubuntu Server 14.04.2 LTS 64bit

Mono:1.0.0-rc1-update1

Coreclr:1.0.0-rc1-update1

Two. Body 1. First we install the Mono environment first

1.1 We first type in the console:

The contents are 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:

Echo " Deb Http://download.mono-project.com/repo/debian wheezy main " sudo Tee /etc/apt/sources.list.d/mono-xamarin.list

1.3 Continue the installation:

The contents are as follows:

sudo apt-get update

1.4 The final step is to formally download mono and install it, which can take a long time

The contents are as follows:

sudo Install Mono-complete

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

Note here, after the reader installation, please look at the version number, your version number should be the same as me or taller than me, if the lower than my installation will have problems, so it is important to confirm that the correct version of mono is installed.

2. Install. NET version control (DNVM)

The contents are as follows:

Curl-ssl https://raw.githubusercontent.com/aspnet/home/dev/dnvminstall.sh | Dnx_branch=dev sh && source ~/.dnx/dnvm/dnvm.sh

3. Installing DNX

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

3.1 Installing DNX must tools

The contents are as follows:

sudo Install libunwind8 gettext libssl-dev libcurl4-openssl-dev zlib1g libicu-dev Uuid-dev

3.2 Installing 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:

DNVM Upgrade-r CORECLR

3.3 Installing DNX for Mono

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

The contents are as follows:

DNVM Upgrade-r CORECLR

3.4 Verifying 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 relationship between DNVM, Dnx, Mono, and coreclr.

3.5 Installing LIBUV

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

sudoApt-getInstall  Makeautomake 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 SHAutogen.SHsudo./Configuresudo  Makesudo  Make Installsudo RM-rf/usr/local/src/libuv-1.8.0&& CD ~/sudoLdconfig

4. Running the official sample

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

After the installation is complete, we download the instance of the flag network to local

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

After switching to this directory through LS we can see which of the several instances:

The official default provides 63 examples of the console, ASP. NET 5 and ASP.

4.2 Running console samples with mono and coreclr

First we switch to this directory:

Then revert to the referenced library:

The specific installation time depends on the reader's network environment, if the following interface shows that the installation is successful:

Then we can use the DNX to run:

The correct output.

Below we will switch DNX to CORECLR to run the program:

The successful switch, below we run directly:

The content was also successfully exported.

4.3 running MVC with mono and coreclr

First we still need to switch to the corresponding directory, remember that the 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 installation successful interface:

This operation is not DNX run, if you want to try to run, the final mistake to believe that the reader can understand, here we need to run through other instructions (DNX Web):

We succeeded in seeing the final effect, below we switch to mono to run once.

The 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#installing-on-debian-ubuntu-and-derivatives

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

Cloud Server under ASP 5 environment (including mono and CORECLR)

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.