Deploying to Linux using vs Code developing. NET Core Applications

Source: Internet
Author: User
Tags dotnet

Using vs Code to develop. NET Core applications deployed to Linux cross-platform

Use the VS Code to develop. NET Core applications deployed to Linux across platforms.

The Vscode development debugging. NET Core is explained earlier. are just running under Windows.

The real core of. NET core is cross-platform, and we now come to learn about the. NET core cross-platform.

Develop a. NET Core application under Windows, and then deploy to the Linux platform to run.

. NET Core Version RC2 is basically complete.

Https://github.com/dotnet/cli/milestones

Can see

1.0.0-rc2

Due by May 6, updated on hours ago 100% complete .

Due by June 1.0.0-rtm.

Environment installation

The development environment of this article: Win10 x64 Vscode 1.0

Download

. NET Core SDK Installer:

Https://dotnetcli.blob.core.windows.net/dotnet/beta/Installers/Latest/dotnet-dev-win-x64.latest.exe

Vscode:

https://code.visualstudio.com/

Vscode C # Plugins:

Https://github.com/OmniSharp/omnisharp-vscode/releases

Development and commissioning

Use Microsoft's official example for development debugging and eventual deployment to Linux.

Https://github.com/aspnet/cli-samples

Let's add a new action.

        [HttpGet ("/info")]        Public Iactionresult Info () {            return Content (". NET core cross-platform Linezero");        }

Visit http://localhost:5000/info

Cross-platform

. NET Core Cross-platform

Environment:

Ubuntu 14.04.4 LTS Server version of the new installation system.

: Http://mirrors.neusoft.edu.cn/ubuntu-releases/14.04.4/ubuntu-14.04.4-server-amd64.iso

You can also download the desktop version of the installation. You can use Vscode to develop debugging directly in Ubuntu.

: http://mirrors.neusoft.edu.cn/ubuntu-releases/14.04.4/

This article deploys the environment: Ubuntu 14.04.4 LTS Server Edition

SDK Installation Method:

http://dotnet.github.io/getting-started/

Use the root user to execute the following command.

Sh-c ' Echo ' Deb [ARCH=AMD64] http://apt-mo.trafficmanager.net/repos/dotnet/trusty main ">/etc/apt/sources.list.d/ Dotnetdev.list ' Apt-key adv--keyserver apt-mo.trafficmanager.net--recv-keys 417a0893apt-get updateapt-get Install dotnet-dev-1.0.0-rc2-002673

After installing the input dotnet--info Display the following information:

The SDK is installed here, so we can develop. NET Core applications in Linux.

Cross-platform operation:

Let's publish the project using dotnet publish

Under Windows, locate the Hellomvc folder to open the command line, and enter dotnet publish

After publishing, upload the publish folder to the Linux system.

Then CD Publish

The direct input dotnet HelloMvc.dll can be executed.

Realize the. NET core cross-platform, which is the true charm of. NET Core.

Look forward to the official version of. NET Core Due by June 1.0.0-rtm.

If you think this article is helpful to you, please click " recommend ", thank you.

Category:. NET Core

Deploying to Linux using vs Code developing. NET Core Applications

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.