.net core linux 编译,在Linux上编译dotnet cli的源代码生成.NET Core SDK的安装包

.NET 的开源,有了更多的DIY乐趣。这篇博文记录一下在新安装的 Linux Ubuntu 14.04 上通过自己动手编译 dotnet cli 的源代码生成 .net core sdk 的 deb 安装包。

1)安装一个现有版本的 .net core sdk

sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list'

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893

sudo apt-get update

apt-get install dotnet-dev-1.0.0-preview2.1-003177

如果不安装,build时会出现下面的错误

dotnet_install: Error: Unable to locate libunwind. Install libunwind to continue

dotnet_install: Error: Unable to locate libicu. Install libicu to continue

2)从 github 上签出 dotnet cli 的源代码

apt-get install git

git clone https://github.com/dotnet/cli.git

3)安装依赖组件 liblldb, devscripts, debhelper

apt-get install liblldb-3.6

apt-get install devscripts

apt-get install debhelper

apt-get install curl

4)运行 build 命令

./build.sh /t:compile

5)build 成功后的输出结果

~/cli/artifacts/ubuntu.14.04-x64/packages# ls

dotnet-host-ubuntu-x64.1.0.1.deb

dotnet-hostfxr-ubuntu-x64.1.0.1.deb

dotnet-sharedframework-ubuntu-x64.1.0.1.deb

注:在 build 时可通过 init-microsoft.dotnet.buildtools.log 日志文件查看 build 进度。

0b1331709591d260c1c78e86d0c51c18.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值