J
Jan Waga
Hello,
I've written and installed windows service in C#. I have two questions:
1)
File.Open("lock", FileMode.OpenOrCreate, FileAccess.Read, FileShare.None)
does not create the file even if it doesn't exist.
Also:
Directory.Exists(ConfigDirectoryName)
returns always true (even if the directory doesn't exists)
I am sure paths are OK, my service runs under LocalSystem account which has
necessary (all, in fact) rights to the application directory. The service
CAN create files in the directory (I've checked).
The same code run from console application works fine.
What may be wrong? Why my service tells me files and directories exist, when
they don't?
2)
Is there some way to control the order in which services stop when the
system shuts down? My service depends on WMI, I have specified this in the
code. But when OnShutdown() code is running, I'm positively sure WMI is no
longer working.
I'd appreciate any help,
Jan
I've written and installed windows service in C#. I have two questions:
1)
File.Open("lock", FileMode.OpenOrCreate, FileAccess.Read, FileShare.None)
does not create the file even if it doesn't exist.
Also:
Directory.Exists(ConfigDirectoryName)
returns always true (even if the directory doesn't exists)
I am sure paths are OK, my service runs under LocalSystem account which has
necessary (all, in fact) rights to the application directory. The service
CAN create files in the directory (I've checked).
The same code run from console application works fine.
What may be wrong? Why my service tells me files and directories exist, when
they don't?
2)
Is there some way to control the order in which services stop when the
system shuts down? My service depends on WMI, I have specified this in the
code. But when OnShutdown() code is running, I'm positively sure WMI is no
longer working.
I'd appreciate any help,
Jan