. NET Core Cross-platform release of Linux and OSX

Source: Internet
Author: User
Tags dotnet

Cross-Platform Publishing

Simply create a new project.

mkdir DOTNETHELLOCD dotnethellodotnet New

dotnet New after modifying Project.json as follows:

{  "version": "1.0.0-*",  "Buildoptions": {    "emitentrypoint": True  },  "dependencies": {    " Microsoft.NETCore.App ": {      " type ":" Platform ",//Remove      " version ":" 1.0.0-rc2-* "    }  },  " frameworks ": {"    netcoreapp1.0 ": {      " Imports ":" Dnxcore50 "    }  },  " runtimes ": {//Join runtime    " Win7-x64 ": {},    " Win7-x86 ": {},    " osx.10.10-x64 ": {},    " osx.10.11-x64 ": {},    " ubuntu.14.04-x64 ": {}  }}

Add Nuget.config

<?xml version= "1.0" encoding= "Utf-8"?><configuration>  <packageSources>    <clear/>    <add key= "Aspnetci" value= "Https://www.myget.org/F/aspnetcirelease/api/v3/index.json"/>    <add key= "nuget.org" value= "Https://api.nuget.org/v3/index.json"/>  </packagesources></configuration >

dotnet Restore

After the restore, you can compile the publication.

Windows:

The default input dotnet publish will publish win7-x64 here.

We navigate to the Win7-x64\publish folder and can execute the Dotnethello.exe directly without installing the. Netcore SDK.

Ubuntu:

We want to post to Linux Ubuntu Direct designation runtime.

dotnet Publish-r ubuntu.14.04-x64

Copy the publishing folder (Ubuntu.14.04-x64/publish) to Ubuntu.

Can be executed directly without the need to install the. Netcore SDK, just. Netcore depends on several packages:

Https://github.com/dotnet/cli/blob/rel/1.0.0/Documentation/cli-prerequisites.md

Ubuntu distributions require the following libraries installed:

    • Libunwind8
    • Libunwind8-dev
    • GetText
    • Libicu-dev
    • Liblttng-ust-dev
    • Libcurl4-openssl-dev
    • Libssl-dev
    • Uuid-dev
    • Unzip

Set the Execute file under folder Dotnethello set permissions directly after./dotnethello

Mac OS:

Like Mac OS, specify OSX runtime.

dotnet Publish-r osx.10.10-x64

Copy the Osx.10.10-x64/publish to Mac OS.

OS X needs to be installed Libssl

OS X requires the following libraries and versions installed:

    • LIBSSL 1.1

Executive Dotnethello

This allows us to run. NET core applications without installing the. NET Core SDK. Implements the. NET Core cross-platform.

Original Http://www.linuxidc.com/Linux/2016-07/133202.htm Linezero

. NET Core Cross-platform release of Linux and OSX

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.