[英]Npgsql assembly error in Classlibrary output type
I have to connect to postgresql via Npgsql provider in nunit test, but I'm facing an assembly error: 我必须在nunit测试中通过Npgsql提供程序连接到postgresql,但我面临一个程序集错误:
System.IO.FileLoadException : Could not load file or assembly 'Npgsql, Version=4.0.1.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7' or one of its dependencies. System.IO.FileLoadException:无法加载文件或程序集'Npgsql,Version = 4.0.1.0,Culture = neutral,PublicKeyToken = 5d8b90d52f46fda7'或其依赖项之一。 Strong name signature could not be verified. 强名称签名无法验证。 The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. 程序集可能已被篡改,或者是延迟签名但未使用正确的私钥完全签名。 (Exception from HRESULT: 0x80131045) at PostgresTest.Testink.ConTest() (来自HRESULT的异常:0x80131045)在PostgresTest.Testink.ConTest()
If I change application output type to Console Application everything works correctly. 如果我将应用程序输出类型更改为控制台应用程序一切正常
Guys, any ideas what am I doing improperly? 伙计们,我有什么不正确的想法吗?
[Test]
public void ConTest()
{
var connString = "Host=127.0.0.1;Username=root;Password=pwd;Database=database";
using (var conn = new NpgsqlConnection(connString))
{
conn.Open();
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.