RestSharp RestRequest构造函数抛出OverflowException

时间:2018-12-01 11:22:10

标签: c# mono restsharp .net-4.6

有时以下行会引发System.OverflowException:

var request = new RestRequest("", Method.GET, DataFormat.Json);

它正在使用Mono Runtime在Raspbian操作系统上运行。 在开发应用程序的Windows上从未发生过该异常。

完整的堆栈跟踪:

[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'RestSharp.RestRequest' threw an exception. ---> 
System.TypeInitializationException: The type initializer for 'System.Text.RegularExpressions.Regex' threw an exception. ---> 
System.OverflowException: TimeSpan overflowed because the duration is too long.
  at System.TimeSpan.Interval (System.Double value, System.Int32 scale) <0xb4a01520 + 0x0010c> in <d0a5e45894084fd7b6ea7e0fe6ac414c>:0
  at System.TimeSpan.FromMilliseconds (System.Double value) <0xb4a0165c + 0x0001b> in <d0a5e45894084fd7b6ea7e0fe6ac414c>:0
  at System.Text.RegularExpressions.Regex..cctor () [0x0001c] in <c0e40d34c25e4827874530676d4126b9>:0
--- End of inner exception stack trace ---
  at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_generic_class_init(intptr)
  at RestSharp.RestRequest..cctor () [0x00000] in <bc58aa49caeb486c80c16d44db0069c3>:0

0 个答案:

没有答案