C# AWS SDK使用单超时错误

C# AWS SDK使用单超时错误,c#,amazon-web-services,mono,amazon-dynamodb,C#,Amazon Web Services,Mono,Amazon Dynamodb,我正在尝试使用mono运行一个连接到DynamoDb的控制台应用程序,它在visual studio中运行良好,但在编译程序并在Ubuntu服务器上运行后,我得到以下输出: [dev@dev Debug]$ mono Server.exe Attempting call Missing method .ctor in assembly /usr/local/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll, type Mono.Se

我正在尝试使用mono运行一个连接到DynamoDb的控制台应用程序,它在visual studio中运行良好,但在编译程序并在Ubuntu服务器上运行后,我得到以下输出:

[dev@dev Debug]$ mono Server.exe
Attempting call
Missing method .ctor in assembly /usr/local/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll, type Mono.Security.Protocol.Tls.CertificateValidationCallback2
Missing method .ctor in assembly /usr/local/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll, type Mono.Security.Protocol.Tls.CertificateValidationCallback2

Unhandled Exception:
Amazon.Runtime.AmazonServiceException: The request timed out ---> System.Net.WebException: The request timed out
  at System.Net.HttpWebRequest.GetRequestStream () [0x00000] in <filename unknown>:0
  at Amazon.Runtime.AmazonWebServiceClient.getRequestStreamCallback (IAsyncResult result) [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at Amazon.Runtime.AmazonWebServiceClient.handleHttpWebErrorResponse (Amazon.Runtime.Internal.AsyncResult asyncResult, System.Net.WebException we) [0x00000] in <filename unknown>:0
  at Amazon.Runtime.AmazonWebServiceClient.getRequestStreamCallback (IAsyncResult result) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: Amazon.Runtime.AmazonServiceException: The request timed out ---> System.Net.WebException: The request timed out
  at System.Net.HttpWebRequest.GetRequestStream () [0x00000] in <filename unknown>:0
  at Amazon.Runtime.AmazonWebServiceClient.getRequestStreamCallback (IAsyncResult result) [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at Amazon.Runtime.AmazonWebServiceClient.handleHttpWebErrorResponse (Amazon.Runtime.Internal.AsyncResult asyncResult, System.Net.WebException we) [0x00000] in <filename unknown>:0
  at Amazon.Runtime.AmazonWebServiceClient.getRequestStreamCallback (IAsyncResult result) [0x00000] in <filename unknown>:0
我尝试了Mono 3.0.12和2.10.8,但都有相同的错误,我使用的是AWSSDK 1.5.26.3。我用来构建Server.exe target.NET4.0的项目,我只是运行xbuild Server.csproj来构建它


我猜这与ssl和缺少的方法消息有关,有人能提供进一步调试的建议或方法吗?我似乎找不到以前发生过的相同错误的报告。

发布此消息后,我立即发现了导致问题的原因

问题出在我的系统中,包括一个旧的Mono.Security.dll,这是节俭的必要条件。通过删除那个过时的dll,我可以毫无错误地运行

using Amazon.DynamoDBv2;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

namespace Server
{
    class Program
    {
        static void Main(string[] args)
        {
            // adding this has no affect, this is never even called
            ServicePointManager.ServerCertificateValidationCallback = (sender, cert, chain, error) => true;

            using (var ddb = new AmazonDynamoDBClient(DynamoServer.Region))                                                                                                                                                            egion))
            {
                Console.WriteLine("Attempting call");
                Console.WriteLine(ddb.ListTables());    
            }
        }
    }
}