Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Cant write to a file

1 view
Skip to first unread message

Damian

unread,
Nov 1, 2004, 12:50:32 AM11/1/04
to
Hi

The following code is what I use to open the file
Dim sw As StreamWriter =
File.AppendText("C:\Inetpub\wwwroot\IView\log\errWebLog.txt")

These are the following permissons I have set:

The ASPNET account set to anonymous login.
The ASPNET account has read/write permissions on the folder
THe folder's properties in IIS has read/write set .

I get the following error message when i try and open and write to a
file in a directory under IIS :

System.UnauthorizedAccessException: Access to the path
"C:\Inetpub\wwwroot\IView\log\errWebLog.txt" is denied. at
System.IO.__Error.WinIOError(Int32 errorCode, String str) at
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess
access, FileShare share, Int32 bufferSize, Boolean useAsync, String
msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String
path, FileMode mode, FileAccess access, FileShare share, Int32
bufferSize) at System.IO.StreamWriter.CreateFile(String path, Boolean
append) at System.IO.StreamWriter..ctor(String path, Boolean append,
Encoding encoding, Int32 bufferSize) at
System.IO.StreamWriter..ctor(String path, Boolean append) at
System.IO.File.AppendText(String path) at
IView.quotethanks.WriteError(String errStr) in
C:\Inetpub\wwwroot\IView\quotethanks.aspx.vb:line 176

Any help will be appreciated

Thanks

ranganh

unread,
Nov 1, 2004, 9:28:09 AM11/1/04
to
Hi Damian,

If you are running Windows 2003, you need to give IIS_WPG Group rights on
that folder. That is the account under which the application runs in Windows
2003 IIS 6.0

Write back if it doesnt help.

Thanks.

Damian M

unread,
Nov 1, 2004, 4:33:01 PM11/1/04
to

Hi rangah,

I am running Windows XP and IIS 5.1 ( this is my developemnt machine ).
For the live server it will be Windows 2000, IIS 5.0


Thanks


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

artanis

unread,
Mar 12, 2007, 2:22:03 PM3/12/07
to
i have the same problem... but i dont get a error message...

dont write the file

From http://www.developmentnow.com/g/14_2004_10_0_0_7145/Cant-write-to-a-file.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com

0 new messages