Rants and Raves

Thanks for visiting my blog!

Upgrading ASP.NET 5 Beta4 to Beta5
Upgrading ASP.NET 5 Beta4 to Beta5
July 22, 2015

For my upcoming course, I have a decent sized example that I’ll be teaching from. In the process of watching ASP.NET 5 go through the sprints, I have to upgrade the project at every step. I feel at some point I should be getting better at dealing with the sprints, but not yet ; )

Here is a short post that includes the different things I had to deal with in upgrading the project. It’s not just the ASP.NET 5 update, but also EF7 and a couple of small details.

First, I followed these instructions I found as an answer to an upgrade problem on SO. It got me close:

http://stackoverflow.com/a/31281489/40125

Next I found that there were a couple of changes for EF7 to work:

First I found that the name of the **optionsBuilder **had changed in the **DbContext.OnConfiguring **method. It used to be called DbContextOptionsBuilder, but in beta 5 it’s called EntityOptionsBuilder. The real rub here is that in Beta 6 it’s going to go back to the old name so you might want to note it:

// Beta6 will revert back to DbContextOptionsBuilder
protected override void OnConfiguring(EntityOptionsBuilder optionsBuilder) 
{
  optionsBuilder.UseSqlServer(Startup.Configuration.Get("Data:tripConnection"));
  base.OnConfiguring(optionsBuilder);
}

```csharp

Next, I noticed that my use of **Include** in LINQ queries wasn’t working. **Include** is now an extension method so I needed to add the namespace:


> **using Microsoft.Data.Entity;**


Lastly, if you’re like me and your Tag Helpers are not working, make sure you didn’t miss the small change that the **\_GlobalImports.cshtml** is now** \_ViewImports.cshtml**. If not, the tag helpers won’t be included.

HTH!