I have a windows service which runs a separate thread with a function which may do
if (!Directory.Exists(TempUpdateDir))
{
DirectoryInfo di = Directory.CreateDirectory(TempUpdateDir);
di.Refresh();
EventLog.WriteEntry("Downloader", string.Format("DEBUG: Trying to create temp dir:{0}. Exists?{1},{2}",TempUpdateDir, Directory.Exists(TempUpdateDir), di.Exists));
}
which does not throw exceptions, Directory.Exists says true (inside if block) and yet there is no such directory on the disk, when you look with explorer. I’ve seen directory created a couple of times, but most of the time directory isn’t created, no exceptions thrown either.
(This service runs under Local System)
Later on this service starts program using Process class and exits. That program is also suppose to work with files, copy them to created directory, but it doesn’t do it either.
Code has problems on Windows 2003 server.
What the….?????????????
My guess is that
TempUpdateDiris a relative directory name, and it doesn’t actually refer to where you think it does. It’s hard to say without any more information though. It would be useful to log the absolute path as well, to make it easier to check.