Installing Npgsql.dll for Postgresql

浪子不回头ぞ 提交于 2020-01-14 19:16:06

问题


So I am having an issue installing npgsql.dll and 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
  2. Go into Visual Studio and start new project. C# Command (not sure which specific project I was supposed to create)
  3. Create a strong key name
  4. Then I try to install the .dll files using gacutil

In the zip file I've downloaded in step 1, I cannot find Npgsql.dll and Mono.Security.dll anywhere...

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:

"Failure adding assembly to cache: ???????????"


回答1:


In Visual Studio 2017, go to menu 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...

More versions are available here: https://www.nuget.org/packages/Npgsql/




回答2:


you can use installation project : https://github.com/npgsql/Npgsql/releases

download MSI package

Thanks




回答3:


Another way to obtain the npgsql.dll file is:

  1. Open Visual Studio and start a new project -- ASP.NET Core for instance.
  2. Use the NuGet Package Manager to install Postgres packages
  3. Open a command prompt and cd to your user directory: 'cd \users\
  4. Look for the dll: 'dir /s/p npgsql.dll'

The dll will be in your project directory. You will also find the dll in the .nuget package directory.



来源:https://stackoverflow.com/questions/32643960/installing-npgsql-dll-for-postgresql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!