View Single Post
  #2 (permalink)  
Old October 27th, 2013, 04:24 AM
Imar's Avatar
Imar Imar is offline
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

Hi Dave,

I assume you have looked at VS 2013.
I have, yes. I am about to finish the first draft of an updated version of the book for VS 2013 and ASP.NET 4.5.1.

So, my question is: in order to stay reasonably close to the procedures in your 4.5 book, should I scrap the 2013 version and install VS 2012?
Some things have changed between VS2012/2013 and ASP.NET 4.5/4.5.1. Most of it will be the same so you won't have trouble following along. However, some things have changed considerably, such as the Entity Framework, leading to the issues you described in the two posts below.

For this particular EF problem, there are a few solutions / alternatives:

1. Drop back to EF 5. In order to do this, delete the .edmx and .tt files from the App_Code folder, delete the EF assemblies from the Bin folder, and remove the references to EF from web.config. Then rebuild the site, add a new ADO.NET Entity Model and choose version 5 in the Choose Your Version dialog. Then delete the .tt files from the App_Code folder, open the EDMX diagam, right-click an empty spot and on the Properties Grid set Code Generation Strategy to Legacy ObjectContext. Then rebuild again, and it should work.

2. Use Model Binding. This is really the recommended solution. The Microsoft / EF team recommends people to stay away from the EntityDataSource control and only use it for Dynamic Data web sites, Model Binding is the preferred solultion. It's pretty clean and straight forward to use, and gives you a lot of control over your queries and object updates. For more info about Model Binding, check out:

My updated book uses the second option and shows how to use Model Binding instead of the EntityDataSource control.

It seems that VS 2013 has some benefits and should be reasonably backward compatible with VS 2012.
Indeed. I would go for 2013 and deal with the differences. The EF issue is probably the largest issue you'll encounter.

I also answered the two separate posts about the problem. You probably shouldn't have posted this in three separate forums as I now had to answer it three times, and then the discussion will continue in three separate places.

Good luck, and let me know if you run into other differences between 2012 and 2013.


Imar Spaanjaars
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following 2 Users Say Thank You to Imar For This Useful Post:
daveharney (October 27th, 2013)