0
错误我正在此:充分利用实体框架(类型初始化除外)
为的类型初始值‘System.Data.Entity.Internal.AppConfig’引发了异常。
在我的实体框架中的错误。
我看了这个Question和可能的答案,但是他们没有为我工作。这是我的App.config文件:
<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>
<connectionStrings>
<add name="SalesReportEntities"
connectionString="metadata=res://*/SalesReportModel.csdl
|res://*/SalesReportModel.ssdl
|res://*/SalesReportModel.msl;
provider=System.Data.SqlClient;
provider connection string="data source=.;
initial catalog=Training;
integrated security=True;
MultipleActiveResultSets=True;
App=EntityFramework""
providerName="System.Data.EntityClient" />
</connectionStrings>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v11.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
</configuration>
其他可能的事情会导致此错误?
其实你是对的!这个问题与你提到的第四个问题有关(我的意思是在我的情况下)。我卸载并重新安装,并且我意识到我没有在第一个中正确管理我的实体框架。再次,非常感谢! –
没有问题,与EF6祝你好运。它与Linq结合使用非常有用,并且了解它如何工作只是战斗的一半。 – djangojazz