I have a ASP.NET MVC program, MVC4+EF5+.net4.0, I want to update to .net4.5. This program have 2 projects, one is library project, another is MVC web site project.
To the library project, I use NuGet update to .net4.5 and the latest EF6, the EF dll version is 6.0.0.0, this is correct.
However to the MVC web site project I update to .net4.5 and EF6, the EF dll version is 4.4, not the 6.0.0.0 version, when compile it have below errors.
Error 51 The type 'System.ComponentModel.DataAnnotations.MaxLengthAttribute' exists in both '\bin\Release\EntityFramework.dll' and 'c:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.ComponentModel.DataAnnotations.dll'
The project is changed to net4.5, why the EF still use the net4.0 version?
I find a post here says web.config not work at EF5 or EF6, but not clearly, is it something in the web.config cause it to use 4.4 version? EF 4.4 -> 5 “Multiple versions were encountered” in MVC4
I find a web.config setting looks like the root cause, however I set it to 4.5, still no luck.
<pages controlRenderingCompatibilityVersion="4.0">