Skip to content

When connectionstring is wrong, we get a wrong exception on dnxcore50 #834

@Eli-Gold

Description

@Eli-Gold
      string ConnectionString = "Server = 127.0.0.1; Port = 5432; Database = mydb; User Id = postgres; Password = mypwd;";


        using (NpgsqlConnection con = new NpgsqlConnection(ConnectionString))
        {
            con.Open();
        }

Let's say the database name is not "mydb" but "MyDb" or a database that does not exists.
The exception we get is :
error CS1705: Assembly 'Npgsql' with identity 'Npgsql, Version=3.1.0.0, Culture=neutral, PublicKeyToken=null' uses 'System.Data.Common, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'System.Data.Common' with identity 'System.Data.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

The exception expected is :
The database "mydb" does not exist

I hope this help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions