Environment deployment for the. Net Core Cross-platform family

Source: Internet
Author: User

Preface
    • As a. NET programmers, many times will be what drag control, cross-platform and other words despise, but in my heart still did not think of themselves. Because in the final analysis, platforms and languages are just the tools we eat. Many times the company's development depends on commercial competition, and Microsoft is no exception. In a big environment, we finally see the cross-platform surprises Microsoft brings to us. Although this is just the beginning, I believe that in the near future, we can truly feel the sincerity of net core, we will always accompany it to grow.
    • When we wanted to be eager to know what it was like to surprise us on the Linux platform, I began to search for a variety of materials, but found that its platform deployment was not so easy (depending on the type and version of the Linux system and the absence of some dependent files). I'll keep a record of my deployment environment to help you reduce the confusion in your deployment environment.
System Environment
    • Local machine: Windows7 x64 flagship edition
    • Virtual machine: Vmware Workstation 10.0.1 build-1379776
    • Linux:ubuntu-14.04.3-desktop-amd64.iso

If the installation of virtual machines and Ubuntu is not clear, please self-Baidu. After installation, in order to adapt to changes in the screen and the copying of files between the host and the virtual machine, we can install VMware Tools, referring to this article

Environment Deployment
    • Installer Code Editor Visual Studio codes, download the latest version to the official website, address: Https://code.visualstudio.com/download Select the compiled. zip file to download.

After downloading the compressed package directly, double-click on the code can open the file editor, open after you can lock Launcher, easy to open later

  

    • Install DNVM (NET version manager), which you can use to manage the installation of different versions of the. NET Runtime Environment DNX (. NET execution Environment) on Linux, and enter the following command:

sudo apt-get install unzip curl

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

After the installation is successful, you can enter the DNVM command to view the following interface:

    • To install the. NET Runtime Environment DNX (. NET execution Environment), which can be understood as the CLR of net CORE, enter the following command:

sudo apt-get install Libunwind8 gettext libssl-dev libcurl4-openssl-dev zlib1g libicu-dev Uuid-dev

DNVM Upgrade-r CORECLR

After the installation is complete, you can enter DNX to view the following interfaces:

And we can also enter DNVM list to see the net version installed on the server.

  

    • Installing the Web server LIBUV,LIBUV is a multi-platform asynchronous IO library used by Kestrel, a cross-platform HTTP server that can host an ASP. NET 5 Web application. Enter the following command:

sudo apt-get install make automake Libtool curl

Curl-ssl https://github.com/libuv/libuv/archive/v1.8.0.tar.gz | sudo tar zxfv--c/usr/local/src

cd/usr/local/src/libuv-1.8.0

sudo sh autogen.sh

sudo./configure

sudo make

sudo make install

sudo rm-rf/usr/local/src/libuv-1.8.0 && cd ~/

sudo ldconfig

    • Install Nodejs, why do you want to install Nodejs? Required for the net template tools that are installed later. You can refer to This article for specific steps.

    • Installing Yeoman, which is a scaffolding platform built on top of node. js, enables you to generate a template-based generator for a project or code file. Enter the following command:

NPM install-g Yo Bower grunt-cli Gulp

NPM install-g generator-aspnet

Console Program

Enter the following command at the command terminal sudo su

As root user operation, for example we now create a demo folder on the desktop, the console program files into this directory, first go to the demo root directory, and then run Yo ASPNET, you will see the following interface:

Select Console application, enter to create our console application, you can type the name of the program

At this point the program has been created successfully, we open Visual Studio code to view the source of the project, open after selecting the project file name Consoleapplication (should be used by default name)

Enter the program root, compile the program, and then execute the program to see the result of running as Hello World, enter the following command with the normal user in the terminal:

Web Program

For example, our web program is also created under the desktop of the demo file, follow the above method under the root user to go to the demo folder, run Yo ASPNET select Web application program to create a Web program.

Load the dependent library file that the Web program needs to reference by running Dnu Restore in the terminal with the normal user going to the Demo/webapplication directory. Such as:

Enter DNX Web command to start the Web server

Enter Http://localhost:5000/in the browser to see the Web program running as shown:

    • In this way, we have finally completed the construction of the Linux under Net platform, the installation process may be different from the environment, there are some errors, these errors can follow the wrong tips on the internet search for answers. The installation of the package recommendations are downloaded to the official website, keep the latest version, to avoid errors caused by different versions.

References

Installing ASP. NET 5 on Linux

Understanding the ASP. NET 5 Runtime commands: DNVM, DNX, and Dnu

Setting up Visual Studio Code

ubuntu14.04 Installing the NODEJS base environment

Environment deployment for the. Net Core Cross-platform family

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.