[Ironpython-users] ironpython and windows services
Curt Hagenlocher
curt at hagenlocher.org
Thu Jan 3 15:39:28 CET 2013
When you add a reference to something in the GAC, don't add ".dll" to the
name. That is,
clr.AddReference('System.ServiceProcess')
On Thu, Jan 3, 2013 at 6:34 AM, Peter Schwalm <ps at peter-schwalm.de> wrote:
> Hello,
> I am trying to convert an Ironpython filewatcher program into a windows
> service. I started by translating a c# example to ipy. I tried to simply
> use System.ServiceProcess.**ServiceBased, and received a message
>
> "AttributeError: attribute 'ServiceProcess' of 'namespace#' object is
> read-only"
>
> I also failed to import System.ServiceProcess.
>
> I also tried to add a Reference to System.ServiceProcess.dll, and even
> that did not work.
>
> Here are the code snippets ...
>
> # coding: latin-1
> import System
> import clr
> #clr.AddReference("System.**ServiceProcess.dll") # fails
> #import System.ServiceProcess # fails
> from System import Array
>
> class Program:
> @staticmethod
> def Main():
> x = System.ServiceProcess.**ServiceBase # fails
> print dir(x)
> ServicesToRun = System.Array[System.**
> ServiceProcess.ServiceBase](
> [
> FolderWatch()
> ])
> ServiceBase.Run(ServicesToRun)**;
>
> prg = Program()
> prg.Main()
>
> Does anyone have an idea, how to accomplish that or - more generally - how
> to make an windows service out of an ipy program?
>
> Thanks in advance
> Peter Schwalm
>
>
> ______________________________**_________________
> Ironpython-users mailing list
> Ironpython-users at python.org
> http://mail.python.org/**mailman/listinfo/ironpython-**users<http://mail.python.org/mailman/listinfo/ironpython-users>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20130103/5281dd3a/attachment.html>
More information about the Ironpython-users
mailing list