Migration from ASP.NET 5 Beta 5 to Beta 6

ASP.NET 5 Beta 6 was released on July 27th with the details from Microsoft in this blog post.  This release comes with a tooling update for Visual Studio 2015 and fewer breaking changes than beta 5.

Download and install the tooling update from here. Grab either DotNetVersionManager-x64.msi or DotNetVersionManager-x86.msi depending on what your system supports and WebToolsExtensionsVS14.msi. For WebToolsExtensionsVS14.msi there are language pack versions available for languages other than english.

With the tooling updates installed the following changes were made from Visual Studio. In global.json update the sdk version to beta 6.

{
    "projects": [ "src", "test" ],
    "sdk": {
        "version": "1.0.0-beta6"
    }
}

For project.json in dependencies section update all the values from beta5 to beta6 except for  Microsoft.Framework.CodeGenerator.Mvc which stays at beta5.

"dependencies": {
  "EntityFramework.SqlServer": "7.0.0-beta6",
  "EntityFramework.Commands": "7.0.0-beta6",
  "Microsoft.AspNet.Mvc": "6.0.0-beta6",
  "Microsoft.AspNet.Mvc.TagHelpers": "6.0.0-beta6",
  "Microsoft.AspNet.Authentication.Cookies": "1.0.0-beta6",
  "Microsoft.AspNet.Authentication.Facebook": "1.0.0-beta6",
  "Microsoft.AspNet.Authentication.Google": "1.0.0-beta6",
  "Microsoft.AspNet.Authentication.MicrosoftAccount": "1.0.0-beta6",
  "Microsoft.AspNet.Authentication.Twitter": "1.0.0-beta6",
  "Microsoft.AspNet.Diagnostics": "1.0.0-beta6",
  "Microsoft.AspNet.Diagnostics.Entity": "7.0.0-beta6",
  "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-beta6",
  "Microsoft.AspNet.Server.IIS": "1.0.0-beta6",
  "Microsoft.AspNet.Server.WebListener": "1.0.0-beta6",
  "Microsoft.AspNet.StaticFiles": "1.0.0-beta6",
  "Microsoft.AspNet.Tooling.Razor": "1.0.0-beta6",
  "Microsoft.Framework.Configuration.Json": "1.0.0-beta6",
  "Microsoft.Framework.Configuration.UserSecrets": "1.0.0-beta6",
  "Microsoft.Framework.CodeGenerators.Mvc": "1.0.0-beta5",
  "Microsoft.Framework.Logging": "1.0.0-beta6",
  "Microsoft.Framework.Logging.Console": "1.0.0-beta6",
  "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-beta6"
}

In Startup.cs in the configure function in the is development section I was able to enable browser link and the UseErrorPage dropped the show all option.

if (env.IsDevelopment())
{
    app.UseBrowserLink();
    app.UseErrorPage();
    app.UseDatabaseErrorPage(DatabaseErrorPageOptions.ShowAll);
}

The LogOff action of the AccountController changed to an async operation.

Before:
public IActionResult LogOff()
{
    SignInManager.SignOut();
    return RedirectToAction("Index", "Home");
}

After:
public async Task LogOff()
{
    await SignInManager.SignOutAsync();
    return RedirectToAction("Index", "Home");
}

The rest of the changes I had to make are entity framework related. The call to apply migrations no longer requires the as relation call.

Before:
Database.AsRelational().ApplyMigrations();

After:
Database.ApplyMigrations();

If you are trying to keep any existing migrations then changes will need to be made in them as well. There is a namespace change related to moving migrations out of the relational area.

Before:
Microsoft.Data.Entity.Relational.Migrations.Infrastructure

After:
Microsoft.Data.Entity.Migrations.Infrastructure

The settings on auto incremented properties changed as well.

Before:
b.Property<int>("ContactId")
    .GenerateValueOnAdd()
    .StoreGeneratedPattern(StoreGeneratedPattern.Identity);

After:
b.Property("ContactId")
    .ValueGeneratedOnAdd();

That is all there is to moving to beta 6 from beta 5. I am going to leave you with some reference links that may help if your project has issues with the move to beta 6.

Release page on Github with all the change in beta 6
Beta 6 Announcements Github page including breaking changes
ASP.NET 5 Roadmap

4 thoughts on “Migration from ASP.NET 5 Beta 5 to Beta 6”

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.