4

Upgrading from ASP.NET v5 Beta4 to Beta5 was a little bit painful, how hard is the upgrade to Beta6?

A cheatsheet like the beta4-beta5 answers would be handy...

Community
  • 1
  • 1
fiat
  • 15,501
  • 9
  • 81
  • 103
  • I just upgraded from beta4 to beta6. Most of my issues were related to beta5 changes. [Announcements](https://github.com/aspnet/Announcements/issues) and [Release Notes](https://github.com/aspnet/Home/releases) can help you through it. – jltrem Jul 31 '15 at 12:59
  • Good question but it would make more sense to make it a wiki page on the official ASP.NET git repo https://github.com/aspnet/home – Victor Hurdugaci Aug 01 '15 at 03:11
  • fair point. There doesn't seem a natural home at the moment. Path suggestions `\Beta\Upgrades\Beta5-Beta6` perhaps? Where is best place to discuss. Raise issue first, then PR a wiki page? – fiat Aug 01 '15 at 04:53

2 Answers2

7

The upgrade went fine. Here is the cheatsheet

Prerequisites

  • Upgrade to beta6: dnvm upgrade
  • Install x64 if you wish: dnvm install 1.0.0-beta6 -arch x64 -r clr
  • Update the alias: dnvm alias default 1.0.0-beta6 x64
  • Set it as permanent default dnvm use default -p
  • Start from Beta 5. Upgrade from Beta 4 to Beta 5 if necessary

Beta 6 Changes

(Not all changes will be applicable to your project)

  • Update global.json from beta5 to beta6
  • Search project.json files for beta5" and replace with beta6"
  • Add reference to Microsoft.AspNet.Mvc.Core
  • Change app.UseErrorPage(ErrorPageOptions.ShowAll); to app.UseErrorPage();
  • Change Context.Authentication.SignIn(...) to SignInAsync(...)
  • Change app.UseSession(c=> c.IdleTimeOut = 30) to app.UseSession()
  • Upgrade Autofac dependencies from "Autofac.Framework.DependencyInjection": "4.0.0-beta5-90" to "Autofac.Framework.DependencyInjection": "4.0.0-beta6-150"

Deployment

Done

Other fixes might be found on the ASP.NET announcements repo

Community
  • 1
  • 1
fiat
  • 15,501
  • 9
  • 81
  • 103
  • Just to say that in Visual Studio 2015, changing the global.json to another version (in this case beta6), prompts to download the new dnx version, if it is not installed. It does so via nuget. – dmcquiggin Aug 01 '15 at 16:19
  • 2
    I also had to add a reference to "Microsoft.AspNet.Mvc.Core" and change app.UseSession(c=> c.IdleTimeOut = 30); to app.UseSession(); and change Context.Authentication.SignIn(...); to SignInAsync(...) – Tom Aug 03 '15 at 15:27
  • Plus: Microsoft.Framework.ConfigurationModel renamed to Microsoft.Framework.Configuration and had to swap out new Configuration(..) for ConfigurationBuilder – hoetz Aug 07 '15 at 11:44
  • have incorporated @toms notes. Feel free to edit answer directly to keep it updated. hoetz - i think that's a beta4-beta5 issue? – fiat Aug 12 '15 at 11:59
  • Does this work for you if creating a new MVC project with Individual Accounts (so that the Identity system is already setup for the project)? Because if I generate a project with beta accounts and upgrades from beta5 to beta6 I get a lot of errors with EF and Identity related stuff. – jimutt Aug 14 '15 at 12:08
  • @jimutt I'm not using EF, feel free to edit answer with your own notes when you solve it though – fiat Aug 14 '15 at 13:05
  • @fiat Alright, well I'm not sure I'll be able to solve it by myself though. I've got a couple of errors I'm quite confused about. But I'll write a comment if I manage to get it working. – jimutt Aug 14 '15 at 13:28
  • I´m getting this error: CS0234 The type or namespace name 'Migrations' does not exist in the namespace 'Microsoft.Data.Entity.Relational' – Beetlejuice Aug 17 '15 at 17:17
  • How did you found out about the changes? I have been so frustrated about the upgrade path and couldn't found out much about it (eg. the new reference) through documentation :s – NicoJuicy Aug 17 '15 at 23:03
0

Update the Answer above answer

You are using EF and getting following error,

type or namespace name 'Migrations' does not exist in the namespace 'Microsoft.Data.Entity.Relational'

then please remove following namespace

using Microsoft.Data.Entity.Relational.Migrations.Infrastructure

and add following namespace

using Microsoft.Data.Entity.Migrations.Infrastructure

Also you have to rewrite few properties like from following property remove the .GenerateValueOnAdd() function.
Some of the property has .StoreGeneratedPattern(StoreGeneratedPattern.Identity) function replace with .UseSqlServerIdentityColumn() function.

    b.Property<string>("Id")
        .GenerateValueOnAdd()
        .Annotation("OriginalValueIndex", 0);

You have to do above things in few files.

Mrugesh
  • 61
  • 7