2016-04-21 3 views
0

Ich bin mit Dotnet CLI-Version 1.0.0-rc2-002439 auf CentOS 7.1Missing auf eine Verbindung mit Npgsql + Dotnet CLI auf CentOS 7.1

ich einen Prototyp Konsolenanwendung erstellt haben, die führt nur eine ausgewählte gegen eine PostgreSQL 9.4 Datenbank.

Ich bin nur auf DNXCORE50 und auf Windows, alles funktioniert gut. Wenn ich es auf CentOS renne erhalte ich die folgende Ausnahme auf conn.Open()

Unhandled Exception: System.MissingMethodException: Method not found: 'Void System.Net.Security.SslStream.AuthenticateAsClient(System.String, System.Security.Cryptography.X509Certificates.X509CertificateCollection, System.Security.Authentication.SslProtocols, Boolean)'. 
at Npgsql.NpgsqlConnector.RawOpen(NpgsqlTimeout timeout) 
at Npgsql.NpgsqlConnector.Open(NpgsqlTimeout timeout) 
at Npgsql.NpgsqlConnector.Open() 
at Npgsql.NpgsqlConnectorPool.GetPooledConnector(NpgsqlConnection Connection) 
at Npgsql.NpgsqlConnectorPool.RequestConnector(NpgsqlConnection connection) 
at Npgsql.NpgsqlConnection.OpenInternal(NpgsqlTimeout timeout) 
at Npgsql.NpgsqlConnection.Open() 
at SensorBot.Core.Services.ConfigService.GetConfig() 
at ConsoleApplication.Program.Main(String[] args) 

Hier die project.json ist Ich verwende:

{ 
    "version": "1.0.0-*", 
    "compilationOptions": { 
    "emitEntryPoint": false 
    }, 
    "dependencies": { 
    "Microsoft.NETCore.App": { 
     "version": "1.0.0-rc2-23811" 
    }, 
    }, 
    "runtimes": { "centos.7-x64": { } }, 
    "frameworks": { 
    "dnxcore50": { 
     "dependencies": { 
     "Microsoft.CSharp": "4.0.1-beta-23516", 
     "System.Collections": "4.0.11-beta-23516", 
     "System.Console": "4.0.0-beta-23516", 
     "System.Linq": "4.0.1-beta-23516", 
     "System.Threading": "4.0.11-beta-23516", 
     "System.IO": "4.1.0-*", 
     "System.IO.FileSystem": "4.0.1-rc2-23811", 
     "System.Runtime.Serialization.Primitives": "4.1.1-*", 
     "System.Dynamic.Runtime": "4.0.11-*", 
     "System.Net.Security": "4.0.0-beta-23405", 
     "System.Net.NetworkInformation": "4.1.0-beta-23405", 
     "System.Text.RegularExpressions": "4.0.12-rc2-23811", 
     "Npgsql": "3.1.0-alpha6" 
     } 
    } 
    } 
} 

ich auf der Npgsql der Github gesehen haben https://www.myget.org/gallery/npgsql-unstable, dass die Verwendung als Paketquelle und die Verwendung der instabilen Version von Npgsql behebt es, aber wenn ich "Npgsql": "3.1.0-unstable0458" verwende, kompiliert die App nicht und sagt, dass diese Version von npgsql nicht mit DNXCore 5.0 kompatibel ist.

Da muss etwas sein, dass ich falsch mache, weil andere Leute anscheinend keine Probleme mehr damit haben.

Irgendwelche Ideen?

Antwort

0

Ich habe die gleiche Ausnahme mit Npgsql Version 3.1.0-alpha6 konnte mich mit beiden Versionen hat

Unhandled Exception: System.MissingMethodException: Method not found: 'Void System.Net.Security.SslStream.AuthenticateAsClient(System.String, System.Security.Cryptography.X509Certificates.X509CertificateCollection, System.Security.Authentication.SslProtocols, Boolean)'.

jedoch erfolgreich zu sein: 3.1.0-unstable0458 und 3.1.0 -unstable0478.
Momentan verwende ich Centos 7.2, Dotnet CLI Version 1.0.0-rc2-002510. Als Testanwendung habe ich eine einfache Konsolen-App mit einer Auswahl zum PostgreSQL erstellt.
project.json sieht wie folgt aus:

{ 
    "version": "1.0.0-*", 
    "compilationOptions": { 
    "emitEntryPoint": true 
    }, 
    "dependencies": { 
    "Microsoft.NETCore.App": { 
     "type": "platform", 
     "version": "1.0.0-rc2-23811" 
    }, 
    "Npgsql": "3.1.0-unstable0478" 
    }, 
"frameworks": { 
    "netcoreapp1.0": { 
     "imports": "dnxcore50", 
    } 
    } 
} 

Weil ich verwenden SSL-Verbindung I paar Optionen auf meine Verbindungszeichenfolge hinzufügen zu db hatte: SSL-Modus = erforderlich; Wahr Vertrauen Server Certificate =; SSL verwenden Stream = True.

Vielleicht sollten Sie versuchen, eine neuere Version von dotnet cli zu verwenden. Wenn Sie Fragen zu meiner os/dotnet-Umgebung haben, lassen Sie es mich wissen.