Windows Server 2003: Shared Folder Access Rights For .NET apps – Microsoft Windows

  windows

Q(Question):

Hello, I’ve searched the net (and this site in particular) but haven’t found anything useful yet. I guess this could be a .NET question too, but I believe it’s a windows permissions question in the first place.

We have a .NET application that read/writes files to a shared folder. It doesn’t use a mapped drive, so it accesses the folder using the \\hostname "scheme". I’ve read that the .NET application should run as a domain user in order to access shared folders on the network. Which is what happens.

When I use internet explorer to access the folder I can read/write/delete anything I want on that drive. But the .NET application seems to have issues. It can create files, but when using "FileInfo.CopyTo(filename, true)" (which copies a file and replaces any files that allready exist with the new name) it gets an Access Denied exception. When first deleting a file if it already exists, I was able to get around this. But for some reason in another folder (in the same share) this seems to offer no solution.

As windows explorer seems to be able to do stuff my .NET application can’t (running under the same user) I’m thinking .NET needs some some other permissions. Is there anybody here who knows if there are some specific settings that need to be set on the server to make sure the share can be accessed by a .NET application? This might seem like a silly question, but I have a hard time understanding why explorer is being allowed to delete files and the .NET application is not.

A(Answer):

LEAVE A COMMENT