M
marc.gibian
I am writing a small Windows Service in C#. It is structured as two C#
programs, one, let's call it myAction, that runs as a command line
program and a second, let's call it myWrapper, that is the actual
windows service, which starts the first program as a child process (and
then waits for the child process to terminate, restarting it should
that ever happen).
When run on its own from a shell window, myAction opens and reads its
input files without any problem.
When run from within myWrapper, myAction appears not to have sufficient
permission to access its input files.
A little additional research has shown that if the input files reside
on the local disk, myAction always works properly, standalone or from
myWrapper. If the files reside on a network drive, only the myWrapper
invocation fails.
The service is instaled with the Visual Studio .NET 2003 generated
setup complete with the necessary ProjectInstaller, containing a
ServiceInstaller and ServiceProcessInstaller. I am specifying my
network login for the service during its installation, and
Environment.UserName seems to indicate the service is indeed running
under my network account.
This application really needs to be able to operate on files residing
both locally and on network drives, so I need to fully understand what
is going on here. I remember there is some magic incantation that needs
recitation for this, but I can't remember the words.
Thanks for your help...
programs, one, let's call it myAction, that runs as a command line
program and a second, let's call it myWrapper, that is the actual
windows service, which starts the first program as a child process (and
then waits for the child process to terminate, restarting it should
that ever happen).
When run on its own from a shell window, myAction opens and reads its
input files without any problem.
When run from within myWrapper, myAction appears not to have sufficient
permission to access its input files.
A little additional research has shown that if the input files reside
on the local disk, myAction always works properly, standalone or from
myWrapper. If the files reside on a network drive, only the myWrapper
invocation fails.
The service is instaled with the Visual Studio .NET 2003 generated
setup complete with the necessary ProjectInstaller, containing a
ServiceInstaller and ServiceProcessInstaller. I am specifying my
network login for the service during its installation, and
Environment.UserName seems to indicate the service is indeed running
under my network account.
This application really needs to be able to operate on files residing
both locally and on network drives, so I need to fully understand what
is going on here. I remember there is some magic incantation that needs
recitation for this, but I can't remember the words.
Thanks for your help...