Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to upgrade ASP.NET 5 from Beta6 to Beta7

Tags:

asp.net-core

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

like image 747
fiat Avatar asked Sep 09 '15 02:09

fiat


1 Answers

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 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

  • Further fixes may be found on the ASP.NET announcements repo
  • Feel free to edit in your own findings
like image 185
fiat Avatar answered Nov 08 '22 18:11

fiat