Why won’t my windows service write to my log file?

I’ve had this issue too. As mentioned by genki you are probably logging into the \Windows\System32 directory. Maybe check for the log file you are expecting there first. When writing services I’ve often put a line like this in the beginning to get the current directory to behave like a normal application

Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);

Leave a Comment