简体   繁体   English

使用 Npgsql 从 Power Query 访问 postgresql

[英]Using Npgsql to access postgresql from Power Query

Using Excel 2016 and trying to access a remote postgresql server with Power Query.使用 Excel 2016 并尝试使用 Power Query 访问远程 postgresql 服务器。 Power Query prompts me to install npgsql. Power Query 提示我安装 npgsql。 Installed the component in the GAC.在 GAC 中安装组件。 Once restarted, Power Query allows me to specify the connection, however I then get the following error: Unable to Connect: We encoutered an error while trying to connect.重新启动后,Power Query 允许我指定连接,但是我收到以下错误:无法连接:我们在尝试连接时遇到错误。 Details: "Could not load file or assembly 'Microsoft.Extensions.Logging.Abstractions, Version=1.1.0.0, Culture=neutral,PublicKeyToken=..... or one of its dependencies. The system cannot find the file specified."详细信息:“无法加载文件或程序集 'Microsoft.Extensions.Logging.Abstractions, Version=1.1.0.0, Culture=neutral,PublicKeyToken=..... 或其依赖项之一。系统找不到指定的文件。”

Repeated on two different environments running Excel 2016. One is 32 bit and the other is 64 bit Excel.在运行 Excel 2016 的两种不同环境中重复。一种是 32 位,另一种是 64 位 Excel。 Same error.同样的错误。

Anyone else encountered this?其他人遇到过这个吗? Any work around?任何解决办法? Should I try to install this package in the GAC?我应该尝试在 GAC 中安装这个包吗? Am I wrong to have installed npgsql with the GAC option?使用 GAC 选项安装 npgsql 是我错了吗?

The dependency on Microsoft.Extensions.Logging was introduced in 3.2, so I'm assuming you're on 3.2.0-beta1 (please confirm if otherwise).对 Microsoft.Extensions.Logging 的依赖是在 3.2 中引入的,所以我假设您使用的是 3.2.0-beta1(如果不是,请确认)。

This is an issue with Npgsql.这是 Npgsql 的问题。 When using the GAC installer (the MSI), the logging dependencies should also be installed into the GAC - currently only Npgsql.dll is installed.使用 GAC 安装程序(MSI)时,日志依赖项也应安装到 GAC 中 - 目前仅安装 Npgsql.dll。

You can work around this by manually installing the missing assemblies yourself - open the Developer Command Prompt as Administrator, and execute gacutil -i for the missing assemblies.您可以通过自己手动安装缺少的程序集来解决此问题 - 以管理员身份打开开发人员命令提示符,然后为缺少的程序集执行gacutil -i

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM