Link to home
Start Free TrialLog in
Avatar of countrymeister
countrymeister

asked on

WCF serive hosted in windows service cannot connect to remote share

I have a WCF servie hosted in a windows service, which tries to read files from a remote network share folder
The wcf service runs fine when run in debug mode, but when the wcf service is run hosted withhin the windows service I get an error
could not find part of the path \\blah\blah\blah

I run the service under my account, which is also true wen I am in debug mode in VS.

Is there something in the config I could specify
Avatar of ste5an
ste5an
Flag of Germany image

The most common reason: Permissions.

You need to consider that your Windows service may run under a different account than yours. And this account may not have access to that share.

So, take a look at the account used in the Log On As column (services.msc on the command line): User generated image
Local System and Network Service do not have access to shares. Thus create your own servics account and give it the necessary permissions to connect to your share.
Avatar of countrymeister
countrymeister

ASKER

ste5an

As I mentioned in my initial request,  I am running the service under my account, I have checked that.
In fact I even logged the Environment.UserName when the service is started to make sure it was my account being used.
What's the exact error message?
I have it in my initial request

could not find part of the path \\blah\blah\blah
 basically i have root directory\subdirectory\susubdirectory
Aha, I have never seen this message. So i can't help you.
ASKER CERTIFIED SOLUTION
Avatar of countrymeister
countrymeister

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
Yeah, silly me. How could I expect a stack trace or the exact exception message..
I had no solution provided by any expert