Re: Windows Service UnauthorizedAccessException

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Thanks. My drive is using its UNC. As for the user the process is running
under, I am not sure how to answer. I run the Windows Forms app under my
logon. Do I need to do something different for the Windows Service on my
machine?

"Ignacio Machin ( .NET/ C# MVP )" wrote:

On Apr 7, 10:18 am, Greyhound <rhill...@xxxxxxxxxxx> wrote:
I have created a Windows Service with C# in VS2008. I created the file
processing code first in a Windows Forms application that reads a flat file
on a network share. I am able to access the directory on the network and
access the files from the Windows Forms application. When I create and
deploy the Windows Service on my PC, I get an 'UnauthorizedAccessException'
exception stating that access to the specified network path is denied. The
code is the same on both applications except for the code required to make
the service run as a service. Are there special permissions required to
access a file on a network share?
Thanks...

under what user your process runs?
how are you accessing the network share? Remember that you will not
have mapped drives so you have to access them by using its UNC: \
\servername\Share\

.



Relevant Pages

  • Re: VB.Net file access problem with UNC
    ... It is compatible with Windows XP - it says so. ... The only problem is when the system is disconnected under UNC. ... This is a legacy network that I have NO control over - and, ... > I didn't even think that Artisoft supported Lantastic any more! ...
    (microsoft.public.dotnet.languages.vb)
  • Re: PID 1212 slowly maxing out?
    ... Windows 2003 servers, but could it affect Windows XP as well? ... I'm on a home network running on wireless. ... Logical Disk Manager service ...
    (microsoft.public.windowsxp.help_and_support)
  • RE: Printing from Win9x clients stops
    ... Open Server Management. ... then right-click the name of the computer running Windows Small Business ... >From the client computer: ... The Select Network Component Type ...
    (microsoft.public.windows.server.sbs)
  • Re: Cant print to my Windows 98 shared printer from my XP compute
    ... >>>I can't print from the printer attached to my Windows 98 machine using my XP ... >>>Add Printer wizard and has a pipe attached, indicating a network printer. ... >>>98 machine and I can successfully ping the 98 machine from my XP laptop. ... >>>driver name showed up as UNIDRV.DLL on my XP test page when it last worked. ...
    (microsoft.public.windowsxp.network_web)
  • Re: Slow file copy to network shares Windows 7
    ... The problem is that Windows 7 copys and pastes the ... folder containing folders and files from a network share to a network ... performed to demonstrate that copying the test folder from a network share ... When copied from a network location and pasted back to a network location ...
    (microsoft.public.windows.file_system)