Link to home
Start Free TrialLog in
Avatar of vizagboy
vizagboy

asked on

.net windows service unable to access mapped network drives

I have a windows service in C# ( not ASP .NET) which should read files from local and remote drives.
Local drives works fine but when i do a directory.Exists() on remote drive, it says filepath not found.
It was mentioned that we cannot use drive letters in windows service. I tried UNC paths also but no luck.
Both the machines are under the same domain, the remote directory has full access to everybody.
I could read the UNC path using windows application though. Tried running the windows service both under local system and network service. Any help is appreciated!
Avatar of Marcjev
Marcjev
Flag of Belgium image

You should use a real account. Both the local account nor the network service account have sufficient rights to access the other computers share. The local system has a name who says it all. The network service account has very limmited access rights and is intended for your computer to present itself to the network. (Like a default asp.net app listening only...)
ASKER CERTIFIED SOLUTION
Avatar of JuckMan
JuckMan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of vizagboy
vizagboy

ASKER

Thanks a lot. Changed the service properties to run the service as a domain user who has access to both the accounts and it worked like a charm. Thank you for the help!