Accessing external file from Windows Service

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tom

    #1

    Accessing external file from Windows Service

    I have a Windows Service that I wrote in VB.NET (2005). I what the
    OnStart method to be able to 'read' an external file - in this case, a
    file on another server.

    The file is on a shared folder on the 'other' server, and I also
    included the metacommand

    Security.Permis sions.FileIOPer mission(Securit y.Permissions.S ecurityActio
    n.Assert)

    onto the OnStart method. However, when the service starts and it
    attempts to read the file, it generates an 'Access to path
    path-goes-here is denied'.

    I thought I had the appropriate permissions set but obviously not. How
    can I give a VB.NET service the 'permission' to read another external
    file (for instance, via StreamReader)? Do I need to give the shared
    file folder a specific permission property? Any help appreciated.

    Tom
    --

Working...