如何将ASP.NET 5从Beta6升级到Beta7 [英] How to upgrade ASP.NET 5 from Beta6 to Beta7
问题描述
将ASP.NET 5 vNext从Beta 6升级到Beta 7的备忘单是什么?
先决条件
- 从Beta 6开始(请参阅之前的笔记)
- 安装 Web工具2015(Beta7)
- 升级到beta7:
dnvm upgrade
- 如果需要,安装x64:
dnvm install 1.0.0-beta7 -arch x64 -r clr
- 更新别名:
dnvm alias default 1.0.0-beta7 x64
- 将其设置为永久默认值
dnvm use default -p
测试版7更改
并非所有更改都适用于您的项目...
- 将
global.json
从beta6
更新到beta7
- 在project.json文件中搜索
beta6"
,并替换为beta7"
- 在project.json中,将
Microsoft.Framework.Runtime.Abstractions
替换为Microsoft.Dnx.Runtime.Abstractions
- 在project.json中,将
Kestrel
替换为Microsoft.AspNet.Server.Kestrel
- 将
using Microsoft.Framework.Runtime;
替换为using Microsoft.Dnx.Runtime;
- 将
configuration.GetConfigurationSection
替换为configuration.GetSection
- 将
configuration.Get("MyConfigKey")
替换为configuration["MyConfigKey"]
- 在Startup.cs中,将
services.AddMvc().Configure<MvcOptions>(options =>
替换为services.AddMvc(options =>
多个具有相同标识错误的程序集
我的单元测试项目有此错误:
Multiple assemblies with equivalent identity have been imported: '<in-memory assembly>' and '<in-memory assembly>'
此博客建议将System.*
引用移至框架特定部分,我发现完全删除它们也是可行的.
TagBuilders
一个人不能再使用TagBuilder.ToString()
来获取HTML,而必须使用它实现的IHtmlContent
.参见 ASP.NET 5 MVC 6中的TagBuilder InnerHtml >
实体框架
- 迁移的新语法:
dnx ef migrations add MyMigration
和dnx ef database update
其他
- 进一步的修补程序可以在 ASP.NET公告存储库
- 随时编辑自己的发现结果
What is the cheatsheet for upgrading from Beta 6 to Beta 7 for ASP.NET 5 vNext?
Prerequisites
- Start from Beta 6 (see prior notes)
- Install Web Tools 2015 (Beta7)
- Upgrade to beta7:
dnvm upgrade
- Install x64 if you wish:
dnvm install 1.0.0-beta7 -arch x64 -r clr
- Update the alias:
dnvm alias default 1.0.0-beta7 x64
- Set it as permanent default
dnvm use default -p
Beta 7 Changes
Not all changes will be applicable to your project...
- Update
global.json
frombeta6
tobeta7
- Search project.json files for
beta6"
and replace withbeta7"
- In project.json, replace
Microsoft.Framework.Runtime.Abstractions
withMicrosoft.Dnx.Runtime.Abstractions
- In project.json, replace
Kestrel
withMicrosoft.AspNet.Server.Kestrel
- Replace
using Microsoft.Framework.Runtime;
withusing Microsoft.Dnx.Runtime;
- Replace
configuration.GetConfigurationSection
withconfiguration.GetSection
- Replace
configuration.Get("MyConfigKey")
withconfiguration["MyConfigKey"]
- In Startup.cs, replace
services.AddMvc().Configure<MvcOptions>(options =>
withservices.AddMvc(options =>
Multiple assemblies with equivalent identity error
My unit test projects had this error:
Multiple assemblies with equivalent identity have been imported: '<in-memory assembly>' and '<in-memory assembly>'
This blog suggested moving System.*
references down to framework specific section, I found removing them entirely also worked.
TagBuilders
One can no longer use TagBuilder.ToString()
to get HTML but instead must make use of the IHtmlContent
that it implements. See TagBuilder InnerHtml in ASP.NET 5 MVC 6
Entity Framework
- New syntax for migrations:
dnx ef migrations add MyMigration
anddnx ef database update
Other
- Further fixes may be found on the ASP.NET announcements repo
- Feel free to edit in your own findings
这篇关于如何将ASP.NET 5从Beta6升级到Beta7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!