0
votes

I have Visual Studio 2012 professional, nd i use to build web applications using these technologies:-

  • asp.net mvc4.
  • Entity framework version 5.

now i have installed an update to my visual studio to support asp.net mvc5, then i download this template http://www.campusmvp.net/blog/extended-template-for-asp-net-mvc-5-from-visual-studio-2012.

I have created a new asp.net mvc5 project based on the templete, but when i run the application i got this error:-

Assembly 'Microsoft.AspNet.Identity.EntityFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' uses 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' which has a higher version than referenced assembly 'EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' c:\Users....\Documents\Visual Studio 2012\Projects\WebApplication3\packages\Microsoft.AspNet.Identity.EntityFramework.1.0.0\lib\net45\Microsoft.AspNet.Identity.EntityFramework.dll WebApplication3

now inside my application web.config file i have the following:-

configuration>
  <configSections>

    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />

  </configSections>

which means i am using EF 5 so why it is trying to reference EF6 ?

1

1 Answers

1
votes

The problem is that ASP.NET Identity is using Entity Framework 6 (because you're using the EF implementation of it). The easiest solution would be to update EF to version 6. Another way (but I wouldn't call it nice) is to add an assembly redirect. Keep in mind that this way can introduce other problems.

If you don't use ASP.NET Identity at all (which is in the template by default), you could also remove all references and the code in the template, which references Identity..