6

I want to create an EntityDataModel with Entity Framework 6 but every time I try I get this error:

Your project references an older version of Entity Framework.

enter image description here

I'm using Visual Studio 2013 and my project is Asp.net 4.5.1 web forms project. this is my web.config file, I deleted some sections of this file in order to solve the problem but all in vain.

<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please   visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</configSections>
<!--
For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.

The following attributes can be set on the <httpRuntime> tag.
  <system.Web>
    <httpRuntime targetFramework="4.5.1" />
  </system.Web>
-->
<system.web>
<compilation debug="true" targetFramework="4.5.1">
  <assemblies/>
</compilation>
<httpRuntime targetFramework="4.5"/>
<customErrors mode="Off"/>
</system.web>
<system.codedom>
<compilers>
  <!--<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701" />
  <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
  -->
</compilers>
</system.codedom>
<appSettings>
<add key="ValidationSettings:UnobtrusiveValidationMode" value="None"/>
</appSettings>
<connectionStrings>
<add name="tebimir_db_tebimEntities" connectionString="metadata=res://*/DataAccessLayer.tebimir_db_tebim.csdl|res://*/DataAccessLayer.tebimir_db_tebim.ssdl|res://*/DataAccessLayer.tebimir_db_tebim.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=tebim.ir,9993;initial catalog=tebimir_db_tebim;persist security info=True;user id=tebimir_dbadmin;password=qwerty*2607548;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient"/>
 <add name="tebimir_db_tebimEntities_plain" connectionString="data source=185.94.97.58,9993;initial catalog=tebimir_db_tebim;persist security info=True;user id=tebimir_dbadmin;password=qwerty*2607548;"/>
 </connectionStrings>
 <system.webServer>
 <defaultDocument>
  <files>
    <clear/>
    <add value="index.aspx"/>
  </files>
</defaultDocument>
 <validation validateIntegratedModeConfiguration="false"/>
</system.webServer>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
  <parameters>
    <parameter value="mssqllocaldb"/>
   </parameters>
  </defaultConnectionFactory>
  <providers>
  <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/>
   </providers>
  </entityFramework>
 </configuration>
Ali.Rashidi
  • 1,284
  • 4
  • 22
  • 51
  • 1
    Lets have look at [this link](http://stackoverflow.com/questions/28241500/cant-create-entity-data-model-using-mysql-and-ef6). It may solve your problem. – Tuks May 28 '16 at 10:38
  • thank you but it is not really related to my question. – Ali.Rashidi May 28 '16 at 10:41
  • is there a problem with my account or something? all my questions never get more than 10 visitors. stack overflow is really a bad site – Ali.Rashidi May 28 '16 at 10:43

3 Answers3

5

Try updating Entity Framework using NuGet Before adding the model, follow these steps

  1. Right click on your project in VS Solution explorer and select 'Manage NuGet packages'

  2. Select EntityFramework ad Click update.

  3. Now add the Entity Data Model.

Mihir Kale
  • 1,028
  • 1
  • 12
  • 20
1

I suggest you to uninstall all the entity framework packages and reinstall it from nuget packages. I hope it will help you.

For more information you can use this link.

Community
  • 1
  • 1
Tuks
  • 23
  • 6
1

Right Click Solution Explorer => Manage Nuget Package => Install Entity Framework

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
Imran
  • 1,951
  • 1
  • 10
  • 7
  • This appears to rehash [this answer](https://stackoverflow.com/a/37497863/1364007). The quote formatting, which I have rolled this answer back to using, is apt. Because this answer duplicates the other answer (and has no up/down votes), there is little point in keeping it. – Wai Ha Lee Apr 01 '19 at 07:00