refs:
ubuntu下运行环境安装:
https://www.microsoft.com/net/core#linuxubuntu
https://docs.microsoft.com/zh-cn/dotnet/core/tools/dotnet-publish
发布运行
http://www.cnblogs.com/linezero/p/5475246.html
http://www.cnblogs.com/ants/p/5659123.html
在工程目录根目录下
Windows:
这里默认输入 dotnet publish 会发布 win7-x64 。
我们定位到 win7-x64\publish 文件夹,可以直接执行 dotnethello.exe ,无需安装.netcore sdk 。
Ubuntu:
我们要发布到linux ubuntu 直接指定 runtime 。
dotnet publish -r ubuntu.16.04-x64
把发布文件夹(ubuntu.16.04-x64/publish)拷贝到ubuntu上。
直接就可以执行.
设置文件夹下的执行文件dotnethello 设置好权限以后直接 ./dotnethello
Mac OS:
同理mac os 一样,指定osx runtime。
dotnet publish -r osx.10.10-x64
将 osx.10.10-x64/publish 拷贝到mac os 。