ASP.NET 5 Migration to RC1 Notes

I’ve been migrating a number of articles from docs.asp.net to RC1 from beta8 (and earlier) and these are some of my notes. You may also find the following links helpful:

Get Latest Version

The first step is to make sure you have the latest bits installed yourself, including the tooling updates (for Visual Studio). The easiest way to do this is to go to get.asp.net.

I’m not going to go through all of the changes that others have previously covered. I just want to point out some errors I ran into and how I resolved them. See Shawn’s post for a more complete walkthrough of changes that are needed to pretty much all beta8 projects to migrate them to RC1.

Error: Could not load type ‘Microsoft.Dnx.Host.Clr.EntryPoint’ from assembly ‘Microsoft.Dns.Host.Clr’

This error can occur because you don’t have a main method in your Startup.cs. This requirement was added in RC1. You can simply copy this into your Startup.cs. Alternately, create a new web project an copy the method from its startup.cs file into your project.

Error: app.UseDatabaseErrorPage(DatabaseErrorPageOptions.Showall)

This method no longer takes a parameter. Replace it with app.UseDatabaseErrorPage().

Entity Framework Updates

EF updated a bunch of the names of its methods for ModelBuilder. Mostly this involved adding “Has” to them.

Change Annotation to HasAnnotation

Change Index to HasIndex

Change ForeignKey to HasForeignKey

I also ran into errors with a model class that didn’t have a setter, which worked in the previous version. I had to make the following change:

 

MVC Updates

If you’re using the default starter web template, there were many changes to AccountController and ManageController. You’re probably best off just copying these in from a new project built using the RC1 templates. You’ll also need RemoveLoginViewModel class from the ViewModels/Manage folder.

IIS Problems

I was able to run the project using Kestrel, but not IIS, until I updated the web.config file located in wwwroot to the following:

That’s all I have for now – if you have questions or other suggestions, please add them to the comments below. Thanks!

  • thanks a lot

  • Hi Steve

    Have you had a chance to look at the state of CORS in the latest version?
    Any tips on getting a simple web API project with a Separate WEB MVC Project in the same solution?
    I’d really be interested in seeing an article on how to do that

    Thanks for the Great Blog and keep up the good work

    Bill Gerold
    BillG@GudAnuf.com
    http://gudanuf.com
    http://gudanuf.net