【发布时间】:2015-05-08 12:25:35
【问题描述】:
这是我的配置...
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<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="DataContext" connectionString="Server=localhost;Port=5432;Database=myDatabase;User Id=postgres;Password=password;Preload Reader = true;" providerName="Npgsql" />
</connectionStrings>
<entityFramework>
<providers>
<provider invariantName="Npgsql" type="Npgsql.NpgsqlServices, Npgsql.EntityFramework" />
</providers>
</entityFramework>
</configuration>
当我运行update-database 时,它会在堆栈跟踪的末尾给出...
找不到 ADO.NET 提供程序的实体框架提供程序 不变名称“System.Data.SqlClient”。确保提供者是 在应用程序配置的“entityFramework”部分注册 文件。更多信息请见http://go.microsoft.com/fwlink/?LinkId=260882 信息。
添加到 entityFramework 部分时遇到的另一个错误..
<defaultConnectionFactory type="Npgsql.NpgsqlFactory, Npgsql" />
未能将 Database.DefaultConnectionFactory 设置为 'Npgsql.NpgsqlFactory, Npgsql' 类型在应用程序中指定 配置。
我错过了什么?
【问题讨论】:
标签: entity-framework postgresql entity-framework-6 npgsql