Ali*_*idi 6 c# asp.net entity-framework
我想用 Entity Framework 6 创建一个 EntityDataModel 但每次我尝试时都会收到此错误:
您的项目引用了旧版本的实体框架。
我使用的是 Visual Studio 2013,我的项目是 Asp.net 4.5.1 Web 表单项目。这是我的 web.config 文件,为了解决问题,我删除了该文件的某些部分,但都是徒劳的。
<?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=\"Web\" /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="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"" 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>
Run Code Online (Sandbox Code Playgroud)
尝试使用 NuGet 更新实体框架 在添加模型之前,请按照以下步骤操作
在 VS 解决方案资源管理器中右键单击您的项目,然后选择“管理 NuGet 包”
选择 EntityFramework 广告 单击更新。
现在添加实体数据模型。
| 归档时间: |
|
| 查看次数: |
4544 次 |
| 最近记录: |