[Mono-bugs] [Bug 425175] New: WebConnectionStream throws exception on write

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Sep 10 10:02:44 EDT 2008


           Summary: WebConnectionStream throws exception on write
           Product: Mono: Class Libraries
           Version: 1.9
          Platform: Other
        OS/Version: openSUSE 11.0
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: mmorano at mikeandwan.us
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

I am using a third party component to interface with their web application, and
have run into a problem on mono where it does not correctly communicate with
the server.  The following program works fine on windows + ms.net, but throws
an exception on mono.

Here is the test program:

using System;
using System.IO;
using System.Net;
using System.Text;

namespace monotest1
        class Program
                public static void Main(string[] args)
                        string url = "https://www.quickbase.com";
                        string content = "<?xml

                        HttpWebRequest req =

                        req.ContentType = "text/xml";
                        req.Method = "POST";
                        byte[] byteArray = Encoding.UTF8.GetBytes(content);
                        req.ContentLength = byteArray.Length;

                        Stream reqStream = req.GetRequestStream();
                        reqStream.Write(byteArray, 0, byteArray.Length);

                        HttpWebResponse resp =



On windows, this completes and prints DONE to the console.  This is what it
looks like on mono:

mmorano at linux-bdlb:~/Desktop/monotest1/bin/Debug> mono --version
Mono JIT compiler version 1.9.1 (tarball)
Copyright (C) 2002-2007 Novell, Inc and Contributors. www.mono-project.com
        TLS:           __thread
        GC:            Included Boehm (with typed GC)
        SIGSEGV:       normal
        Notifications: epoll
        Architecture:  x86
        Disabled:      none

mmorano at linux-bdlb:~/Desktop/monotest1/bin/Debug> mono --debug monotest1.exe 

Unhandled Exception: System.Net.WebException: Error writing request.
  at System.Net.WebConnectionStream.WriteRequest () [0x00169] in
  at (wrapper remoting-invoke-with-check)
System.Net.WebConnectionStream:WriteRequest ()
  at System.Net.HttpWebRequest.CheckIfForceWrite () [0x0003b] in
  at System.Net.HttpWebRequest.BeginGetResponse (System.AsyncCallback callback,
System.Object state) [0x000a6] in
  at System.Net.HttpWebRequest.GetResponse () [0x00000] in
  at monotest1.Program.Main (System.String[] args) [0x00000] 

I have this same issue on my linux box at home, which is using a recent mono
version from SVN.

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list