I have to connect to postgresql via Npgsql provider in nunit test, but I'm facing an assembly error:
System.IO.FileLoadException : Could not load file or assembly 'Npgsql, Version=4.0.1.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7' or one of its dependencies. 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()
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();
}
}
This was an issue with the building of 4.0.1 (see issue) and will be fixed in 4.0.2 (to be released in a few days). In the meantime stick with 4.0.0.
User contributions licensed under CC BY-SA 3.0