. NET core cross-platform Publishing (dotnet publish), which can be run without the. NET core SDK installed.
The Vscode development of. NET Core is explained earlier. Now let's talk about the release (dotnet publish).
The. NET core and ASP. 1.0 RC2 Runtime and libraries were released in mid-May.
. NET core and ASP. 1.0 RTM (release) runtime and libraries released at the end of June.
https://blogs.msdn.microsoft.com/dotnet/2016/05/06/net-core-rc2-improvements-schedule-and-roadmap/
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/> <AddKey= "Aspnetci"value= "Https://www.myget.org/F/aspnetcirelease/api/v3/index.json" /> <AddKey= "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:
Executive Dotnethello
This allows us to run. NET core applications without installing the. NET Core SDK. Implements the. NET Core cross-platform.
If you think this article is helpful to you, please click " recommend ", thank you.
. NET Core Cross-platform Publishing (dotnet publish)