RestSharp RestRequest Конструктор, выбрасывающий OverflowException - PullRequest
0 голосов
/ 01 декабря 2018

Иногда в следующей строке выдается исключение System.OverflowException:

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

Это выполняется в ОС Raspbian с использованием Mono Runtime.Исключение никогда не случалось в Windows, где было разработано приложение.

Full Stacktrace:

[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
...