Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 374415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T14:24:12+00:00 2026-05-12T14:24:12+00:00

I have a C# .NET service that runs as DOMAIN\username on a windows server

  • 0

I have a C# .NET service that runs as DOMAIN\username on a windows server and it needs to access a network share \\share\export docs$\.

If I’m logged into the machine (as DOMAIN\username) I can see the share and I have even mapped it to X: and tried to use that. I set the path in app.config (and restart the service) and if I use a path on C: it works fine but if I try using \\share\export docs$\ or X:\ it can’t see any of the files I need to access.

I have tried running the service as both a local user and as DOMAIN\username

Any ideas what I might be doing wrong?

EDIT: Stacktrace from log:

Could not find a part of the path 'X:\200909\11324709\coo.pdf'.
    at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
    at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
    at System.Net.Mail.AttachmentBase.SetContentFromFile(String fileName, String mediaType)

at System.Net.Mail.Attachment..ctor(String fileName)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T14:24:12+00:00Added an answer on May 12, 2026 at 2:24 pm

    Mapped drives in .Net are a bit buggy. However, this type of situation comes up in questions here quite a bit. You wold be better to specify the UNC path.

    This isn’t the exact same question you asked, but this post is relevant to your question and should help you out.

    How do I access a file share programattically

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET web service that I can access via a windows program
I have a Windows Service that runs on my Texas origin Server Central Time.
I have a VB.NET Windows Service that I wrote and it works fine. In
I have a .NET Windows service and a .NET Web Application that I would
Background: I have a .NET 4.0 web service running on Windows Server 2008 written
We have a service that runs methods used for data import/export at specified intervals.
I have a .NET Windows service that I would like to port to Mono
We have a .net monitoring service that runs on several PCs installed across the
I have a Windows service that has been scheduled using Quartz.NET . I have
I have a windows service application that runs as Local System, and I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.