简体   繁体   English

为Postgresql安装Npgsql.dll

[英]Installing Npgsql.dll for Postgresql

So I am having an issue installing npgsql.dll and mono.security.dll. 所以我在安装npgsql.dll和mono.security.dll时遇到问题。 I've been trying to figure this out for so long... please help. 我一直在努力解决这个问题......请帮忙。 Here are the steps I've done... 以下是我所做的步骤......

  1. Download zip file from https://github.com/npgsql/npgsql https://github.com/npgsql/npgsql下载zip文件
  2. Go into Visual Studio and start new project. 进入Visual Studio并开始新项目。 C# Command (not sure which specific project I was supposed to create) C#命令(不确定我应该创建哪个特定项目)
  3. Create a strong key name 创建一个强大的密钥名称
  4. Then I try to install the .dll files using gacutil 然后我尝试使用gacutil安装.dll文件

In the zip file I've downloaded in step 1, I cannot find Npgsql.dll and Mono.Security.dll anywhere... 在我在步骤1中下载的zip文件中,我无法在任何地方找到Npgsql.dll和Mono.Security.dll ...

I've also tried downloading other zip files that have actually had those files, however, when I try to install them in command (gacutil /i C:...\\Npgsql.dll) I just keep getting the following error: 我也尝试下载实际上有这些文件的其他zip文件,但是,当我尝试在命令中安装它们时(gacutil / i C:... \\ Npgsql.dll)我只是不断收到以下错误:

"Failure adding assembly to cache: ???????????" “将程序集添加到缓存失败:???????????”

In Visual Studio 2017, go to menu Tools-> NuGet Package Manager-> Package Manager Console. 在Visual Studio 2017中,转到菜单Tools-> NuGet Package Manager-> Package Manager Console。 Run command: 运行命令:

Install-Package Npgsql -Version 3.2.7

To unstall version 3.2.7... and so on... 要卸载版本3.2.7 ......依此类推......

More versions are available here: https://www.nuget.org/packages/Npgsql/ 这里有更多版本: https//www.nuget.org/packages/Npgsql/

you can use installation project : https://github.com/npgsql/Npgsql/releases 您可以使用安装项目: https//github.com/npgsql/Npgsql/releases

download MSI package 下载MSI包

Thanks 谢谢

Another way to obtain the npgsql.dll file is: 获取npgsql.dll文件的另一种方法是:

  1. Open Visual Studio and start a new project -- ASP.NET Core for instance. 打开Visual Studio并启动一个新项目 - 例如ASP.NET Core。
  2. Use the NuGet Package Manager to install Postgres packages 使用NuGet包管理器安装Postgres包
  3. Open a command prompt and cd to your user directory: 'cd \\users\\ 打开命令提示符并cd到您的用户目录:'cd \\ users \\
  4. Look for the dll: 'dir /s/p npgsql.dll' 找dll:'dir / s / p npgsql.dll'

The dll will be in your project directory. 该DLL将位于您的项目目录中。 You will also find the dll in the .nuget package directory. 您还可以在.nuget包目录中找到dll。

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

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