.NET跨平台之旅:升级ASP.NET Core示例站点
2016-04-26 12:30
1006 查看
ASP.NET Core示例站点网址:http://about.cnblogs.com/
首先安装最新版的 .NET Core 运行环境,从 https://github.com/dotnet/cli 的 readme 中 "Ubuntu Installers" 部分获取 Shared Host、Shared Framework、Sdk 的下载地址,分别依次下载安装:
安装后的 dotnet cli 版本是 1.0.0-rc2-002496 。
然后修改示例站点项目 AboutUs 的 project.json 文件:
1)frameworks 中的 "netstandardapp1.3" 改为 "netcoreapp1.0" ,imports 由 "portable-net45+win8" 改为 "portable-net45+wp80+win8+wpa81+dnxcore50"
2)dependecies 中添加:
接着将 NuGet.Config 中的 aspnetcidev 改为 aspnetcirelease:
dotnet restore 之后,dotnet run 时出现错误:The dependency Ix-Async 1.2.5 does not support framework .NETCoreApp,Version=v1.0。在这个问题上困了很长时间,直到今天看到这篇博文 —— .NET Core 1.0 RC2 历险之旅,才发现了如下的解决方法:
在 "frameworks" -> "netcoreapp1.0" -> "imports" 中添加 "portable-net45+win8+wp8+wpa81" 与 "portable-net45+win8+wp8" 。
解决这个问题之后,升级成功!
首先安装最新版的 .NET Core 运行环境,从 https://github.com/dotnet/cli 的 readme 中 "Ubuntu Installers" 部分获取 Shared Host、Shared Framework、Sdk 的下载地址,分别依次下载安装:
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 。
然后修改示例站点项目 AboutUs 的 project.json 文件:
1)frameworks 中的 "netstandardapp1.3" 改为 "netcoreapp1.0" ,imports 由 "portable-net45+win8" 改为 "portable-net45+wp80+win8+wpa81+dnxcore50"
2)dependecies 中添加:
"Microsoft.NETCore.App": { "type": "platform", "version": "1.0.0-rc2-23931" },
接着将 NuGet.Config 中的 aspnetcidev 改为 aspnetcirelease:
<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 历险之旅,才发现了如下的解决方法:
在 "frameworks" -> "netcoreapp1.0" -> "imports" 中添加 "portable-net45+win8+wp8+wpa81" 与 "portable-net45+win8+wp8" 。
"frameworks": { "netcoreapp1.0": { "imports": [ "portable-net45+wp80+win8+wpa81+dnxcore50", "portable-net45+win8+wp8+wpa81", "portable-net45+win8+wp8" ] } }
解决这个问题之后,升级成功!
相关文章推荐
- Asp.Net alert弹出提示信息的5种方法
- 【推荐】【给中高级开发者】构建高性能ASP.NET应用的几点建议
- ASP.NET中Literal与Label控件的区别
- asp.net创建XML文件的方法小结
- ASP.NET中Cookie的使用方法
- JAVA8 JVM的变化: 元空间(Metaspace)
- ASP.NET 中的Application详解
- asp.net 执行存储过程 无输出参数 有两个输入参数
- asp.net实现在XmlTextWriter中写入一个CDATA的方法
- asp.net简单生成XML文件的方法
- Raspberry Pi3 ~ 搭建开发环境
- ASP.NET MVC 整合 Spring.net- Controller注入
- ASP.NET的优点
- 【推荐】【给中高级开发者】构建高性能ASP.NET应用的几点建议
- ASP.NET教程收集
- asp.net简单生成XML文件的方法
- asp.net实现在XmlTextWriter中写入一个CDATA的方法
- ASP.NET 中的Application详解
- ASP.NET中Cookie的使用方法
- asp.net创建XML文件的方法小结