1

我正在尝试运行一个使用单声道连接到 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

这是我正在运行的代码

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());    
            }
        }
    }
}

我尝试使用 Mono 3.0.12 和 2.10.8 并且都有相同的错误,我使用的是 AWSSDK 1.5.26.3。我用来构建 Server.exe 的项目目标是 .net 4.0,我只是运行 xbuild Server.csproj 来构建它

我猜它与 ssl 和 Missing 方法消息有关,任何人都可以提供任何建议或方法来进一步调试吗?我似乎找不到以前发生过同样错误的报告。

4

1 回答 1

2

在发布此消息后,我立即发现了这个导致我遇到问题的旧错误

问题出在我包括一个旧的 Mono.Security.dll 是 Thrift 的要求。通过删除那个过时的 dll,我可以正常运行

于 2013-07-17T06:01:49.083 回答