fiat
fiat

Reputation: 15981

How to upgrade ASP.NET 5 (vnext) from Beta5 to Beta6

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

Upvotes: 4

Views: 1404

Answers (2)

Mrugesh
Mrugesh

Reputation: 61

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.

Upvotes: 0

fiat
fiat

Reputation: 15981

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

Upvotes: 7

Related Questions