ASP.NET Core示例站點網址:http://about.cnblogs.com/html
首先安裝最新版的 .NET Core 運行環境,從 https://github.com/dotnet/cli 的 readme 中 "Ubuntu Installers" 部分獲取 Shared Host、Shared Framework、Sdk 的下載地址,分別依次下載安裝:git
wget https://dotnetcli.blob.core.windows.net/dotnet/beta/Installers/Latest/dotnet-host-ubuntu-x64.latest.deb dpkg -i dotnet-host-ubuntu-x64.latest.deb wget https://dotnetcli.blob.core.windows.net/dotnet/beta/Installers/Latest/dotnet-sharedframework-ubuntu-x64.latest.deb dpkg -i dotnet-sharedframework-ubuntu-x64.latest.deb wget https://dotnetcli.blob.core.windows.net/dotnet/beta/Installers/Latest/dotnet-sdk-ubuntu-x64.latest.deb dpkg -i dotnet-sdk-ubuntu-x64.latest.deb
安裝後的 dotnet cli 版本是 1.0.0-rc2-002496 。github
而後修改示例站點項目 AboutUs 的 project.json 文件:json
1)frameworks 中的 "netstandardapp1.3" 改成 "netcoreapp1.0" ,imports 由 "portable-net45+win8" 改成 "portable-net45+wp80+win8+wpa81+dnxcore50"ubuntu
2)dependecies 中添加:windows
"Microsoft.NETCore.App": { "type": "platform", "version": "1.0.0-rc2-23931" },
接着將 NuGet.Config 中的 aspnetcidev 改成 aspnetcirelease:api
<configuration> <packageSources> <clear /> <add key="AspNetCI" value="https://www.myget.org/F/aspnetcirelease/api/v3/index.json" /> <add key="NuGet.org" value="https://api.nuget.org/v3/index.json" /> </packageSources> </configuration>
dotnet restore 以後,dotnet run 時出現錯誤:The dependency Ix-Async 1.2.5 does not support framework .NETCoreApp,Version=v1.0。在這個問題上困了很長時間,直到今天看到這篇博文 —— .NET Core 1.0 RC2 歷險之旅,才發現了以下的解決方法:app
在 "frameworks" -> "netcoreapp1.0" -> "imports" 中添加 "portable-net45+win8+wp8+wpa81" 與 "portable-net45+win8+wp8" 。ide
"frameworks": {
"netcoreapp1.0": {
"imports": [
"portable-net45+wp80+win8+wpa81+dnxcore50",
"portable-net45+win8+wp8+wpa81",
"portable-net45+win8+wp8"
]
}
}
解決這個問題以後,升級成功!post