ASP.NET 2.0 Write File (IIS 6.0/Windows 2003)

ASP.NET 2.0 Write File (IIS 6.0/Windows 2003)

am 16.04.2008 23:38:19 von Henok Girma

Hello,
I wanted to write to a folder from my ASP.NET web app, but i get

Access to the path 'C:\Inetpub\wwwroot\Test\Logs\test.log' is denied. at
System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at
System.IO.FileStream.Init(String path, FileMode mode, FileAccess access,
Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize,
FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean
bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode,

here is what i did

i created a Virtual Directory Test
under it there is a folder Logs
i set the propery from IIS of the logs folder to 'write'

i changed the security permission of the folder from windows explorer(right
click|properties)
and added the user IUSR_ and ASPNET user.. i gave both users
FULL ACCESS, yet i am still not able to write to that folder.

am I missing something?

any help is greatly appreciated

Re: ASP.NET 2.0 Write File (IIS 6.0/Windows 2003)

am 16.04.2008 23:44:43 von Henok Girma

ok, i got it.. i had add to the user IIS_WPG..



"Henok Girma" wrote in message
news:2AB2945A-EAB7-4C8B-A76E-AE9CBD4AE453@microsoft.com...
> Hello,
> I wanted to write to a folder from my ASP.NET web app, but i get
>
> Access to the path 'C:\Inetpub\wwwroot\Test\Logs\test.log' is denied. at
> System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at
> System.IO.FileStream.Init(String path, FileMode mode, FileAccess access,
> Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize,
> FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean
> bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode,
>
> here is what i did
>
> i created a Virtual Directory Test
> under it there is a folder Logs
> i set the propery from IIS of the logs folder to 'write'
>
> i changed the security permission of the folder from windows
> explorer(right click|properties)
> and added the user IUSR_ and ASPNET user.. i gave both users
> FULL ACCESS, yet i am still not able to write to that folder.
>
> am I missing something?
>
> any help is greatly appreciated