0

CentOS 7.1 で Dotnet CLI バージョン 1.0.0-rc2-002439 を実行しています

PostgreSQL 9.4 データベースに対して選択を実行するだけのプロトタイプのコンソール アプリケーションを作成しました。

私は DNXCORE50 のみを対象としており、Windows ではすべて正常に動作します。CentOSで実行すると、次の例外が発生します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)

私が使用しているproject.jsonは次のとおりです。

{
  "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"
      }
    }
  }
}

npgsql の Github でhttps://www.myget.org/gallery/npgsql-unstable、パッケージ ソースとして使用し、不安定なバージョンの Npgsql を使用すると修正されることを見てきましたが"Npgsql": "3.1.0-unstable0458"、アプリを使用するとコンパイルされず、このバージョンの npgsql は DNXCore 5.0 と互換性がないと表示されます。

他の人はもうこれで問題を抱えていないように見えるので、私が間違っていることがあるに違いありません.

何か案は ?

4

1 に答える 1

0

npgsql バージョン3.1.0-alpha6でも同じ例外がありました

未処理の例外: System.MissingMethodException: メソッドが見つかりません: 'Void System.Net.Security.SslStream.AuthenticateAsClient(System.String, System.Security.Cryptography.X509Certificates.X509CertificateCollection, System.Security.Authentication.SslProtocols, Boolean)'.

ただし、両方のバージョンで成功することができました: 3.1.0-unstable04583.1.0-unstable0478
現在、Centos 7.2、Dotnet CLI バージョン1.0.0-rc2-002510を使用しています。テスト アプリケーションとして、postgresql を 1 つ選択する単純なコンソール アプリを作成しました。
project.jsonは次のようになります。

{
  "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",
    }
  }
}

私は db への SSL 接続を使用しているため、接続文字列にいくつかのオプションを追加する必要がありました: SSL Mode=Require;Trust Server Certificate=True;Use SSL Stream=True

新しいバージョンの dotnet cli を使用してみてください。私の os/dotnet 環境について質問がある場合は、お知らせください。

于 2016-04-27T01:26:59.563 に答える