The. NET core 1.x deployment method is described in detail at the website Https://docs.microsoft.com/zh-cn/dotnet/core/deploying/deploy-with-vs
Or a little summary, because of the use VS more, so the VS deployment approach as an example
There is no third party dependencies do not make a difference description, anyway, after using NuGet installation will automatically modify the csproj file
The. NET core framework relies on deployment: At this point, there is no difference between 1.x and 2.0, normal generation, release
Standalone deployment: The main difference is the modification of the csproj file
First, you need to add runtimeidentifiers tags
For 1.x, fill in the content win10-x64;osx.10.11-x64
Detailed system Support List Https://docs.microsoft.com/zh-cn/dotnet/core/rid-catalog
The complete csproj file contains the following
<project sdk= "MICROSOFT.NET.SDK" >
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp1.1</TargetFramework>
<runtimeidentifiers>win10-x64;o sx.10.11-x64</runtimeidentifiers>
</PropertyGroup>
<ItemGroup>
< Packagereference include= "Newtonsoft.json" version= "10.0.3"/>
</ItemGroup>
</Project>
For 2.0, fill in the content slightly different, win-x64;linux-x64;osx-x64
Complete csproj file contents are as follows
<project sdk= "MICROSOFT.NET.SDK" >
<PropertyGroup>
<RuntimeIdentifiers>win-x64; linux-x64;osx-x64</runtimeidentifiers>
<OutputType>Exe</OutputType>
< targetframework>netcoreapp2.0</targetframework>
</PropertyGroup>
<ItemGroup>
<packagereference include= "Newtonsoft.json" version= "10.0.3"/>
</ItemGroup>
</Project>
Rebuild Project after modification
Select Target platform and click Publish
You can then copy the entire output directory to the target platform host and run it.