Solved

WCF serive hosted in windows service cannot connect to remote share

Posted on 2014-09-10
8
319 Views
Last Modified: 2014-10-06
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
0
Comment
Question by:countrymeister
  • 4
  • 4
8 Comments
 
LVL 33

Expert Comment

by:ste5an
ID: 40316408
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): Services
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.
0
 
LVL 1

Author Comment

by:countrymeister
ID: 40317386
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.
0
 
LVL 33

Expert Comment

by:ste5an
ID: 40317435
What's the exact error message?
0
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
LVL 1

Author Comment

by:countrymeister
ID: 40319573
I have it in my initial request

could not find part of the path \\blah\blah\blah
 basically i have root directory\subdirectory\susubdirectory
0
 
LVL 33

Expert Comment

by:ste5an
ID: 40319597
Aha, I have never seen this message. So i can't help you.
0
 
LVL 1

Accepted Solution

by:
countrymeister earned 0 total points
ID: 40323521
Hi ! Ste5an
Thank you for trying to help me.
Please make an attempt to read the question fully, instead of asking what is already in the initial request.
Would save us all a lot of time.
0
 
LVL 33

Expert Comment

by:ste5an
ID: 40324971
Yeah, silly me. How could I expect a stack trace or the exact exception message..
0
 
LVL 1

Author Closing Comment

by:countrymeister
ID: 40363284
I had no solution provided by any expert
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question