@Dani_S , thanks for the feedback, based on my search, I find that it may be related your code about create the xml file when running it as a windows service. Please refer to the question FileNotFoundException when running a Windows Service to use the following code to set your relative path of the file.
String path = System.Reflection.Assembly.GetExecutingAssembly().Location;
path = System.IO.Path.GetDirectoryName(path);
Directory.SetCurrentDirectory(path);
If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.