Migration from ASP.NET 5 Beta 6 to Beta 7

On September 2nd ASP.NET 5 beta 7 was released. As with beta 6 this release includes a tooling update for Visual Studio. Read the announcement here.

The tooling update can be found here. The relevant files are either DotNetVersionManager-x64.msi or DotNetVersionManager-x86.msi depending on what your system supports and WebToolsExtensionsVS14.msi.

After installing the tooling update change the sdk version in global.json to beta 7.

In the project.js file update beta6 to beta7 in the dependencies section.

In Startup.cs replace the Microsoft.Framework.Runtime namespace with Microsoft.Dnx.Runtime.

The remaining changes are related to entity framework 7. ApplyMigrations has been change to Migrate.

Any migration designer.cs files will need the following changes. The Microsoft.Data.Entity.Migrations.Infrastructure namespace is now Microsoft.Data.Entity.Infrastructure.

ContextType has changed to DbContext.

The ProductVersion property has been removed and BuildTargetModel is now protected.

The Microsoft.Data.Entity.Migrations.Builders namespace is now Microsoft.Data.Entity.Migrations.Operations.Builders.

Any classes that inherit from the Migration need the Up and Down functions changed to protected.

The AddCoumn of MigrationBuilder now needs a type specified and nullable has changed to isNullable.

The last change to MigrationBuilder that I ran into was with table.ForeginKey. referencedTable and referencedColumn changed to principleTable and principalColumns.

That was all the changes needed to get my test project updated. Here is the Github release page and breaking changes page for this release.

Migration of an existing project through the betas does work, but I recommend creating a new project every couple of betas. Things are changing in the project templates as well the core of ASP.NET 5. At the very least create a new project and look through the startup class and implement anything new that you find useful.  For example the debug logger is now included when creating a new project.

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

  1. Thanks for your post!
    Just nitpicking; can you fix one block of code with regards to:
    >> The AddColumn of MigrationBuilder now needs a type specified and nullable has changed to isNullable.
    It should contain the generic signature: AddColumn right?

Leave a Reply

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