I need to read some files from a mapped drive, I have to access this drive in a mapped way because it is outside the domain. This is troubling me because if I run my code as a Console application in C#, I can access it correctly, instead if I convert the same code to Windows service I can not: it throws me an exception in Event Viewer saying that the username and password are not correct. I've been looking information about but I couldn't find a clear answer.
I'm getting this from event viewer.
"Access to the path is denied"
I've tried to set my service to run as User account. also setting the credentials in ProjectInstaller class like this
serviceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.User;
serviceProcessInstaller1.Username = "domain\\UserName";
serviceProcessInstaller1.Password = "password";
maybe it is not possible to access?