?
Solved

WCF serive hosted in windows service cannot connect to remote share

Posted on 2014-09-10
8
Medium Priority
?
342 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 35

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 35

Expert Comment

by:ste5an
ID: 40317435
What's the exact error message?
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
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 35

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 35

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

How To Reduce Deployment Times With Pre-Baked AMIs

Even if we can't include all the files in the base image, we can sometimes include some of the larger files that we would otherwise have to download, and we can also sometimes remove the most time-consuming steps. This can help a lot with reducing deployment times.

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

801 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