- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试将 Postgres 数据库连接到 EDMX 设计器。
我已经安装了 EntityFrameowrk6.npgsql block 模块,如下所述:http://www.npgsql.org/ef6/index.html (数据库已经有了uuid-ossp扩展名)
然后我安装了扩展包,如下所述:http://www.npgsql.org/doc/ddex.html
最后,我将 npgsql 模块更新为 v3.2.1 以匹配集成文档中建议的扩展版本。
我可以使用 visual studio 的服务器浏览器连接到我的数据库。
完成此操作后,我已将 ado.net 实体数据模型添加到我的项目中,但他对我可用的唯一提供程序是 Microsoft sql 的。看不到 Postgres!
我正在运行 Visual Studio Community 2017,它是完全最新的,唯一安装的其他扩展是 AnkhSVN。这是一个当前为 .net 4.5.1 配置的 C# 项目(但我非常高兴并愿意更改目标框架以使一切正常工作!)
我的项目中唯一的 Nuget 包是上面描述的那些及其依赖项。
很多谷歌搜索结果只是各种教程告诉我基本上做上面的事情,或者人们向 app.config 添加元素(我已经尝试过但失败了,然后恢复了)npgsql 文档明确指出你不应该需要做的。
非常感谢任何帮助!
编辑:这是我目前的 App.Config。
<?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" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" />
</startup>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="Npgsql" type="Npgsql.NpgsqlServices, EntityFramework6.Npgsql" />
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Npgsql" publicKeyToken="5d8b90d52f46fda7" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.2.1.0" newVersion="3.2.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
最佳答案
原来我遇到的问题是我在添加 NuGet 后没有重建我的项目/解决方案。主要是因为我正在用 Postgre 替换旧的 SQL EF 实现,并且由于大量缺少引用而无法构建。
这里的问题表明重建是应该发生的事情:Entity Framework 6.1.1 and Npgsql 2.2.3: Compatible Entity Framework database provider could not be found
因此,我注释掉了我的大部分代码,重新构建,并且提供程序出现在我期望的位置。
它 使 Visual Studio 崩溃(嘶嘶声!),但这是一个单独的问题。
我希望这对一些可怜的人有帮助。
关于c# - Npgsql Entityframework - 看不到 ADO.net 实体数据模型的 Postgres 提供程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42858144/
全部: 我们使用 ASP.NET Web 窗体开始了我们的项目。 我们的 ASP.NET C# web 应用程序在以下环境中使用 .NET Framework 4 ASP.NET Web Forms.
我在尝试为 Entity Framework Core 添加迁移到 Code First 项目时遇到错误,这里是详细信息... 我创建了一个新的 ASP.Net Core Web 项目(VS 2017
Error 1 Copying file bin\EntityFramework.SqlServer.xml to obj\Debug\Package\PackageTmp\bin\Entit
我有一个WPF应用程序,我使用了MVVM体系结构,数据库sql server compact 4。 首先是Entityframework.sqlserverCompact数据库,我使用了通用存储库模式
例如,将 products.Where(p => p.LastModifiedOn > someDate) 总是以相同的订单返回产品(无论如何订购,只要每次调用相同的代码时都是一致的)?或者我应该添加
好吧,假设我有一个用户表,然后是一个记录所有登录尝试的表(Id(计数器)、userId、时间以及是否成功) 现在在我的实体模型中,我希望它成为 2 个关联的一个,包含所有成功尝试的时间和一个包含所有不
我正在努力处理如何最好地跨多个 Visual Studio 项目分解域模型。我正在使用 EntityFramework 4 和企业类型模式来合理化一个可以重用于各种应用程序的系统。最终我想得到一组可以
是否可以使用 POCO 和 EF 处理以下情况?我想要一个 Vehicles 表,有一些 bool 字段,如 IsFast、IsVan、IsTruck,然后有一个 Vehicles 类,有一个 Fas
当我通过传递比较泛型类型 TId 的谓词调用 DbSet.FirstOrDefault() 时,出现以下异常: unable to create a constant value of type 's
我正在使用 EF5 将一些数据从一个数据库迁移到另一个数据库。我通常会使用 SQL 来做这样的事情,但是我需要其他功能(比如在 MembershipProvider 中创建用户)并且希望在 EF 中完
我创建了一个单独的项目并将我的模型复制到这个项目中。我引用了 using System.ComponentModel.DataAnnotations 我的模型定义如下: public class F
上下文: 我有两个类在 SQL 中有两个对应的表。 系统信息 EF 版本: SQL 版本:2012 类 public class Employee { public Employee(
我有一个定义了主从关系的 Entity Framework 对象。详细信息对象集合有一个导航属性。 在稍后的代码中,我尝试使用 AutoMapper 将其中一个主对象映射到数据传输对象。但是,数据传输
有没有办法让这个通用 Context.SalesEntity.Where(t=>t.id==3).Delete(); 有点像 private void DoWork(Expression> predi
来自 NHibernate 背景 - 我有一些审计列来反射(reflect)谁最后编辑了一条记录,以及该编辑发生的时间。 我已经覆盖了 SaveChanges 以寻找一个公共(public)基类,并使
我是 EntityFramework 6 的新手,一直在 POCO 中遇到问题。 以下是我的代码 Domain.cs public abstract class BaseEntity { [K
我刚在单元测试项目中遇到一个问题,坚持认为它需要 EntityFramework 的引用,我确信它不需要它。其他项目正在引用单元测试项目正在引用/测试的项目/扩展方法,并且在不引用 EntityFra
下面的代码应该做什么?在此代码中添加包含表的目的是什么,它应该对与 PersonId 相关的 JobType 进行级联删除,还是只删除具有指定 PersonId 的 Person ? db.tblPe
我试图了解延迟加载在 Entity Framework 6 中是如何工作的。在我看来,延迟加载只适用于 DbContext,其中“to-be-loaded”属性已经存在访问过。请查看下面的示例 - 测
这个问题在这里已经有了答案: 关闭 10 年前。 Possible Duplicate: Entity Framework Validation EntityFramework有什么好的灵活的验证框
我是一名优秀的程序员,十分优秀!