[EMAIL PROTECTED] 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
Index: ChangeLog
===================================================================
--- ChangeLog (revision 61521)
+++ ChangeLog (working copy)
@@ -1,3 +1,7 @@
+2006-06-07 Robert Jordan <[EMAIL PROTECTED]>
+
+ * mono-service.cs: Fixed entry point invocation.
+
2005-12-27 Jonathan Pryor <[EMAIL PROTECTED]>
* mono-service.cs: Use non-obsolete Mono.Posix.dll types.
Index: mono-service.cs
===================================================================
--- mono-service.cs (revision 61521)
+++ mono-service.cs (working copy)
@@ -207,9 +207,11 @@
error (logname, "Entry point not defined in
service");
return 1;
}
-
- string [] service_args = new string [0];
- entry.Invoke (null, service_args);
+
+ if (entry.GetParameters ().Length == 0)
+ entry.Invoke (null, null);
+ else
+ entry.Invoke (null, new object [] { new string
[0] });
return 0;
_______________________________________________
Mono-devel-list mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/mono-devel-list