Note that there are some explanatory texts on larger screens.

plurals
  1. POHttpWebRequest crashing outside MonoDevelop
    text
    copied!<p>I wrote a method to submit an error-report via HTTP POST. I run OSX-Lion and MonoDevelop. The code works when the application is called from MonoDevelop. When I run the .app it throws an exception:</p> <pre><code>System.TypeInitializationException: An exception was thrown by the type initializer for System.Net.WebRequest ---&gt; System.DllNotFoundException: libc.dylib at (wrapper managed-to-native) System.Platform:uname (intptr) at System.Platform.get_IsMacOS () [0x00000] in &lt;filename unknown&gt;:0 at System.Net.WebRequest..cctor () [0x00000] in &lt;filename unknown&gt;:0 --- End of inner exception stack trace --- at ch.fangorn.LIF.Access.SubmitCrash.Submit (Int32 projectId) [0x00000] in &lt;filename unknown&gt;:0 </code></pre> <p>At the moment I call the Submit method directly not via a catch. Since it works when a debugger is attached I'm stranded. What I so far tried:</p> <ol> <li>Build a mono application bundle (Create mac installer)</li> <li>Build everything with Platform target x86</li> <li>The beta version of Mono and MonoDevelop</li> </ol> <p>The code that IMO causes the crash.</p> <pre><code>HttpWebRequest hwr = WebRequest.Create(turi) as HttpWebRequest; string authInfo = user + ":" + password; authInfo = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo)); hwr.Headers["Authorization"] = "Basic " + authInfo; hwr.Method = "POST"; hwr.ContentType = "text/xml"; hwr.ContentLength = encData.Length; Stream send = hwr.GetRequestStream(); send.Write(encData, 0, encData.Length); send.Close(); hwr.GetResponse(); </code></pre> <p>MonoDevelop: 2.8.5<br/> Mono: 2.10.8</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload