[Mono-bugs] [Bug 549580] New: Overridden WebClient.GetWebRequest method isn't called

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Oct 23 10:33:16 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=549580


           Summary: Overridden WebClient.GetWebRequest method isn't called
    Classification: Mono
           Product: Mono: Class Libraries
           Version: SVN
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Core
        AssignedTo: jbevain at novell.com
        ReportedBy: alexmipego at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.14)
Gecko/2009090216 Ubuntu/9.04 (jaunty) Firefox/3.0.14

When inheriting the WebClient class and implementing a overridden GetWebRequest
method, the code isn't called by the base class and/or normal internal
processes.

Reproducible: Always

Steps to Reproduce:
1. Compile and run the following code:
using System;
using System.Net;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            TestWebClient t = new TestWebClient();
            t.DownloadData("http://www.mono-project.com");
        }
    }

    class TestWebClient : WebClient
    {
        protected override WebRequest GetWebRequest(Uri address)
        {
            Console.WriteLine("Override Called");
            return base.GetWebRequest(address);
        }
    }
}
Actual Results:  
The code wasn't called.

Expected Results:  
The code should be called.

Code runs on MS.Net successfully.

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


More information about the mono-bugs mailing list