CentOS 7.1下安裝dotnet core,centosdotnet

來源:互聯網
上載者:User

CentOS 7.1下安裝dotnet core,centosdotnet

.NET CORE的官方(http://dotnet.github.io/getting-started/)只提供了Windows, Ubuntu14.04, 及Docker(也是基於Ubuntu14.04做的Image). 但鑒於微軟已經把RedHat做為參考平台而且用Ubuntu14.04做Server我心裡還是沒底的. 所以想著在CentOS下配置.NET CORE的環境

開始我也是走的編譯源碼的路線,然後....搞編譯環境實在是不是我強項,難道木有簡單無腦的辦法,我是個懶人

忽然的靈感是ubuntu,mac下列印的資訊是

.NET Command Line Tools (1.0.0-beta-001598)

於是在github在找這個項目(https://github.com/dotnet/cli), 找到這個項目後一看README,賓果,我想要的包找到了.

可以下載最新的包:https://dotnetcli.blob.core.windows.net/dotnet/beta/Binaries/Latest/dotnet-centos-x64.latest.tar.gz

但是因為官網上ubuntu及docker等等推薦的都是1.0.0.001598這個版本號碼,尷尬癌... 好吧, 試了一下

https://dotnetcli.blob.core.windows.net/dotnet/beta/Binaries/1.0.0.001598/dotnet-centos-x64.1.0.0.001598.tar.gz

成功了.

於是可以開始了.

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 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.