[Mono-dev] [PATCH] Re: mono-service possible bug fix

Robert Jordan robertj at gmx.net
Wed Jun 7 07:51:59 EDT 2006


pablosantosluac at terra.es wrote:
> Hi all,
> 
> Sorry for my previous thread hijacking. Didn't realize about it.
> 
> Well, it seems there is a bug in mono-service. Whenever it tries to
> launch a service application it raises an exception in mono-service.cs
> at method StartService.
> 
> The code is doing something like:
> 
> string [] service_args = new string [0];
> 
> entry.Invoke(null, service_args);
> 
> return 0;
> 
> And it raises the exception "Number of parameter does not match expected 
> count"
> 
> Doing the following changes the problem seems to be solved.
> 
> 
> string [] service_args = new string [0];
> 
> object[] obj = new object[1];
> 
> obj[0] = service_args;
> 
> entry.Invoke(null, obj);
> 
> 
> return 0;
> 
> 
> 
> I replaced the mono-service.exe on my Fedora4/mono-1.1.15 and now it works.

It might work with your service but it fails if the service
assembly has an entry point with an empty parameter list
(static void Main ()).

The attached patch works for both entry points.

Robert

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mono-service.diff
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060607/4e4cc392/attachment.pl 


More information about the Mono-devel-list mailing list