From: Iain on

I am getting an error with the following code :


When trying to write to this directory the following error is returned :

UnauthorizedAccessException: Access to the path

This directory exists but for some reason I can't access it via my
ASP.NET application.

I have granted NETWORK_SERVICE access to this folder.

On my dev environment this error doesn't appear.

Windows Server version is 2007.

Any ideas?

From: Patrice on

AFAIK, when something runs under NETWORK SERVICE it is seen as <machine
name>$ by other servers. Also the network share also has permissions.

Unrelated but my personal preference would be to use \\myserver\MyDirectory
(Windows uses \, http uses /).