.NET CORE的官方(http://dotnet.github.io/getting-started/)只提供了Windows, Ubuntu14.04, 及Docker(也是基于Ubuntu14.04作的Image). 但鉴于微软已经把RedHat作为参考平台并且用Ubuntu14.04作Server我内心仍是没底的. 因此想着在CentOS下配置.NET CORE的环境git
开始我也是走的编译源码的路线,而后....搞编译环境实在是否是我强项,难道木有简单无脑的办法,我是个懒人github
突然的灵感是ubuntu,mac下打印的信息是docker
.NET Command Line Tools (1.0.0-beta-001598)ubuntu
因而在github在找这个项目(https://github.com/dotnet/cli), 找到这个项目后一看README,宾果,我想要的包找到了.windows
能够下载最新的包:https://dotnetcli.blob.core.windows.net/dotnet/beta/Binaries/Latest/dotnet-centos-x64.latest.tar.gzcentos
可是由于官网上ubuntu及docker等等推荐的都是1.0.0.001598这个版本号,尴尬癌... 好吧, 试了一下socket
https://dotnetcli.blob.core.windows.net/dotnet/beta/Binaries/1.0.0.001598/dotnet-centos-x64.1.0.0.001598.tar.gzide
成功了.测试
因而能够开始了.centos7
1. virtualbox 安装最小化的centos7.1, 安装wget
2. 安装.NET CORE
1). #:cd ~
2). #:mkdir dotnet
3). #:cd dotnet
2). #:wget https://dotnetcli.blob.core.windows.net/dotnet/beta/Binaries/1.0.0.001598/dotnet-centos-x64.1.0.0.001598.tar.gz
3). #:tar -zxf dotnet-centos-x64.1.0.0.001598.tar.gz
3. 测试、运行:
接上面步骤
1). #:cd bin
2). #:./dotnet
提示错误:
Failed to load /root/dotnet/bin/libcoreclr.so, error: libunwind.so.8: cannot open shared object file: No such file or directory
fix: yum install libunwind
3). #:./dotnet
Failed to initialize CoreCLR, HRESULT: 0x80131500
fix: yum install icu (别问我为何知道,嘿嘿)
4). #:./dotnet
4. 配置环境变量
1). #:vi /etc/profile
在最后面添加
PATH=~/dotnet/bin:$PATH
export PATH
2). #:source /etc/profile
如今能够和ubuntu, mac, docker下同样使用.net core编译、运行,发布你的项目啦
玩.NET CORE, 如今会遇到各类各样的问题如MySql的provider, Redis的Provider... 在没有官方版的状况下只能本身改或彻底重写了
附: 修改可用的MySql.Data, 我只记得改了SHA1验证, socket链接的API也不同了, 为了容易经过, 像Pipeline, File等链接方式也去掉了,只保留了TCP, 其它可能还有改动, 因此仅供娱乐, 开心就好
https://git.coding.net/zlzforever/share.git