. Net Native Cross-platform attempts

Source: Internet
Author: User

The open source of Microsoft's platform has intensified, and in the previous two days of Connect (), not only released the latest. NET Core RC1, but also further open source. NET native cross-platform implementation.

. Net Native Runtime:

Https://github.com/dotnet/corert

. NET command-line toolchain:

Https://github.com/dotnet/cli

. Net native provides both normal mode and CPP mode:

Normal mode is similar to the existing UWP. Net Native, which compiles il directly into machine code and then links to the run-time library.

The CPP mode compiles the IL into C + + source code and compiles it using the C + + compiler, similar to the Unity3d Il2cpp, which has a good cross-platform foreground.

The following is the Linux Ubuntu 14.04 attempt process (Windows failed):

Install the necessary tools

apt-get  updateapt-Get -y Install Curl Libicu-dev libunwind8 gettext Libssl-dev Libcurl4-openssl-dev zlib1gapt-Get -y install autoconf automake build-essential Libtool

In the CLI project, the Deb installation package is available in two formats with tar.gz, I download the Deb installation and fix the dependencies

mkdir DOTNETCLI
Dotnetcli
wget Https://dotnetcli.blob.core.windows.net/dotnet/dev/Installers/Latest/dotnet-linux-x64.latest.deb
dpkg Dotnet-linux-x64.latest.deb
Apt-get-y-F Install

Then set the environment variable (you can write the/etc/profile file if a restart is available)

Export Dotnet_home=/usr/share/dotnet

Enter dotnet to see the following output indicating successful installation

. NET Command Line interfaceusage:dotnet [Common-options] [Command] [arguments]arguments:  [Command]     The command to execute  [arguments]   arguments to pass to the Commandcommon Options (passed before the command): 
    -v|--verbose  Enable verbose outputcommon Commands:  compile       compiles a. NET Project  Publish       for  deployment  run           compiles and immediately executes a. NET Project

Download the sample code using git

Cd/root
git clone https://github.com/dotnet/core.git

Restore the NuGet package first

cd/root/core/samples/helloworlddotnet Restore

Compiling with. Net Native Normal Mode

dotnet Compile--native

Compiling with. Net Native CPP Mode

dotnet Compile--native--cpp

No error means success, you can run the test

Cd/root/core/samples/helloworld/bin/debug/dnxcore50/native
Ls
./helloworld

You can see the successful output

Hello world!

Note: The current. Net native can only run HelloWorld and Dotnetbot under samples, but I believe it will be ready for full use soon, as development is nearing the end, and now the problem is with the tool

. Net Native Cross-platform attempts

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.