Create a folder, write a file to a shared folder on the server
My windows service creates a directory in the shared folder and I get the error:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Directory.InternalCreateDirectory(String fullPath, String path,DirectorySecurity dirSecurity)
at System.IO.Directory.CreateDirectory(String path, DirectorySecurity directorySecurity)
at System.IO.Directory.CreateDirectory(String path) at
I am referencing a shared folder like: \\255.255.255.255\myfolder.uploads\
Any ideas on what should I do to write to this folder? This tab contains the Everyone and fullcontrol settings.
Update
Do I have to impersonate the user on another server in some way?
source to share
There can be several things depending on the platform your server is running on. As a complete (and assuming a Windows based server) cross-validation, both share and folder have write permissions granted to the corresponding user account.
Simply granting share permissions may not work.
Hope it helps!
source to share
To ensure security on shared folders on .net, you need to configure .net security using the ".NET Framework Configuration Tool" .
source to share
I think you should explicitly start the service with the NetworkService account:
MSDN under the NetworkService account
It is different from the LocalSystem account you are using:
MSDN under the LocalSystem account
Hope it helps.
source to share