Visual Studio 2015 中的向导中缺少 PostgreSQL 数据提供程序 [英] PostgreSQL data provider missing from wizard in Visual Studio 2015

查看:26
本文介绍了Visual Studio 2015 中的向导中缺少 PostgreSQL 数据提供程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我花了一天时间尝试将 Entity Framework 6 SQL Server CE 迁移到 PostgreSQL.

我已经很好地复制了数据库,但我似乎无法让数据提供者工作.

首先,我尝试了 EF 提供程序的旧 2.2.7 版本,它不需要 .NET 4.5(因为我们的项目无法使用它),但这不起作用.我一直在使用 NpgsqlConnection 而不是 SqlConnectionStringBuilder 并将 app.config 更改为与 Host 的连接字符串(我尝试了 Server 但它不喜欢它)和 Database 值,并确保 EF 部分如下:

<entityFramework><defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/><提供者><provider invariantName="Npgsql" type="Npgsql.NpgsqlServices, EntityFramework6.Npgsql"/></提供者></实体框架>

我现在忽略了这个限制,只是为了让它工作,所以我有 EF 提供程序的 EF6 v3.1.1 版本和最新的 .NET 提供程序 (v3.2.2),但这也不起作用.

为了修复它,我也一直在尝试通过安装 VS2015 扩展将 EDMX 从 SQL Server CE 重新同步到 PostgreSQL 替代品,但它只是给出一条消息说发生了错误,所以我试过这个:https://github.com/npgsql/npgsql/issues/1514它走得更远,打开了窗户,但我一输入框就崩溃了.自从将项目升级到 .NET 4.5 后,这个提供程序就根本不再出现了……

我已经尝试过多次重新安装所有内容并重新启动 VS,并且由于升级我还尝试安装 GAC 文件,因为不清楚 VS 扩展是否需要它们(也是 v3.2.2).

有没有人能够阐明如何最容易地让所有这些工作,最好不需要 .NET 4.5?

谢谢

解决方案

我通过安装 Visual Studio 扩展 Npgsql PostgreSQL 集成 得到了它.按照此页面上的说明操作:https://www.npgsql.org/efcore/p>

这个帖子让我找到了正确的道路:添加自定义数据源到视觉工作室 2015

I've spent a day trying to migrate an Entity Framework 6 SQL Server CE to PostgreSQL.

I've copied the database over fine, but I can't seem to get the data provider to work.

Firstly I tried the older 2.2.7 version of the EF provider, which doesn't require .NET 4.5 (because our project can't use it), but that didn't work. I've been using NpgsqlConnection instead of SqlConnectionStringBuilder and changed the app.config to have a connection string with Host (I tried Server but it didn't like it) and Database values, and made sure the EF section is as follows:

<entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
    <providers>
        <provider invariantName="Npgsql" type="Npgsql.NpgsqlServices, EntityFramework6.Npgsql" />
    </providers>
</entityFramework>

I've now ignored this limitation just to try and get it working, so I have the EF6 v3.1.1 version of the EF provider and the latest .NET provider (v3.2.2) and that's not working either.

In an attempt to fix it, I've also been trying to re-sync the EDMX from the SQL Server CE to the PostgreSQL replacement by installing the VS2015 extension, but it just gave a message saying an error occurred, so I tried this: https://github.com/npgsql/npgsql/issues/1514 which got further, opening the window, but then crashed as soon as I typed into the boxes. Since upgrading the project to .NET 4.5, this provider no longer appears at all...

I've tried reinstalling everything several times and restarting VS a lot, and Since upgrading I've also tried installing the GAC files, as it wasn't clear if the VS extension needed them (also v3.2.2).

Is anyone able to shed some light on how easiest to get all this working, preferably without the requirement of .NET 4.5?

Thanks

解决方案

I got it working with installing the Visual Studio Extension Npgsql PostgreSQL Integration. Follow the instruction on this page: https://www.npgsql.org/efcore/

This thread led me to the right path: Add custom data source to visual studio 2015

这篇关于Visual Studio 2015 中的向导中缺少 PostgreSQL 数据提供程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆