c# - RestSharp is crashing with Unity3d when running on iPhone -
i'm trying attach restsharp unity3d. original restsharp mono lib works fine in editor, on device crashing callstack
argumentoutofrangeexception: argument out of range. parameter name: options @ system.security.cryptography.x509certificates.x509certificatecollection.getenumerator () [0x00000] in <filename unknown>:0 @ system.text.regularexpressions.regex.validate_options (regexoptions options) [0x00000] in <filename unknown>:0 @ system.text.regularexpressions.regex..ctor (system.string pattern, regexoptions options) [0x00000] in <filename unknown>:0 @ restsharp.restclient..ctor () [0x00000] in <filename unknown>:0 @ restsharp.restclient..ctor (system.string baseurl) [0x00000] in <filename unknown>:0
that means, exception appears inside of ctor restclient(string), wrapper around default ctor. , inside of default ctor, there
public restclient() { #if windows_phone this.usesynchronizationcontext = true; #endif this.contenthandlers = new dictionary<string, ideserializer>(); this.accepttypes = new list<string>(); this.defaultparameters = new list<parameter>(); // register default handlers this.addhandler("application/json", new jsondeserializer()); this.addhandler("application/xml", new xmldeserializer()); this.addhandler("text/json", new jsondeserializer()); this.addhandler("text/x-json", new jsondeserializer()); this.addhandler("text/javascript", new jsondeserializer()); this.addhandler("text/xml", new xmldeserializer()); this.addhandler("*+json", new jsondeserializer()); this.addhandler("*+xml", new xmldeserializer()); this.addhandler("*", new xmldeserializer()); this.followredirects = true; }
at point, dont see next step regex ctor appears. ideas?
we have encountered same issue while building standalone windows project unity 5.2.1. in editor works fine, until create build.
i believe problem has 'structuredsyntaxsuffixwildcardregex' used in 'addhandler' method. while don't know why fails, know previous version of restsharp work us.
i guess you're using latest restsharp version, give restsharp v105.1.0 try?
it seemed stop functioning restshap v105.2.1, going through commits see possible culprit. fork , fix if have found solution.
also must inform in our case gzip decompression wasn't working due missing mono.posix libraries. problem occurred when server returned gzipped response , restclient allowed it. had work around using 'fabman08's fix made decompression configurable.
Comments
Post a Comment