如何将ASP.NET 5从Beta6升级到Beta7 [英] How to upgrade ASP.NET 5 from Beta6 to Beta7

查看:48
本文介绍了如何将ASP.NET 5从Beta6升级到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.jsonbeta6更新到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 MyMigrationdnx ef database update

其他

What is the cheatsheet for upgrading from Beta 6 to Beta 7 for ASP.NET 5 vNext?

Prerequisites

Beta 7 Changes

Not all changes will be applicable to your project...

  • Update global.json from beta6 to beta7
  • Search project.json files for beta6" and replace with beta7"
  • In project.json, replace Microsoft.Framework.Runtime.Abstractions with Microsoft.Dnx.Runtime.Abstractions
  • In project.json, replace Kestrel with Microsoft.AspNet.Server.Kestrel
  • Replace using Microsoft.Framework.Runtime; with using Microsoft.Dnx.Runtime;
  • Replace configuration.GetConfigurationSection with configuration.GetSection
  • Replace configuration.Get("MyConfigKey") with configuration["MyConfigKey"]
  • In Startup.cs, replace services.AddMvc().Configure<MvcOptions>(options => with services.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 and dnx ef database update

Other

这篇关于如何将ASP.NET 5从Beta6升级到Beta7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆