[Mono-dev] Bug in default site

Brian Crowell brian at fluggo.com
Mon Jan 30 12:32:35 EST 2006

The default site created by the System.ComponentModel.Container class does not 
pass service requests (IServiceProvider.GetService()) to its container unless 
the requested service is of type ISite. That's just batty, because anyone trying 
to get the site this way won't get it, and anyone trying to get any other 
service from the container won't get it.

The offending code is in Container.cs:

105     if (typeof(ISite) != t) {
106         return null;
107     }

The fix is simple:

105     if (typeof(ISite) == t) {
106         return this;
107     }

I've also attached a test program so you can see the difference between the .NET 
implementation and the Mono implementation of this class.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: TestSite.cs
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060130/61eadf2f/attachment.pl 

More information about the Mono-devel-list mailing list