RE: Cant write to a file

From: ranganh (ranganh_at_discussions.microsoft.com)
Date: 11/01/04


Date: Mon, 1 Nov 2004 06:28:09 -0800

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" wrote:

> 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
>



Relevant Pages

  • Re: Cant access file. Please, help.
    ... Not unless he's running Windows Server 2003. ... I think shapper is running Windows XP Pro. ... the account would be: ... FileAccess access, Int32 rights, Boolean useRights, FileShare share, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Big problem/Need Help
    ... Take Ownership of a File or Folder in Windows XP ... You must be logged on to the computer using an account that has administrative ... If you are running Windows XP Home Edition, in order to have access to ... "Access is Denied" Error Message When You Try to Open a Folder ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Mail box locations
    ... I looked further into Outlook. ... Scroll down to "Import your messages or account from OE to ... >>I don't know about Outlook - but in OE the store folder can be found by ... I am running Windows XP Home Edition on ...
    (microsoft.public.windows.inetexplorer.ie6.outlookexpress)
  • Re: Help with configuration
    ... to redirect their My Documents folder to a share on the fileserver. ... GPo, if it is already redirecting by default? ... account profile is blank, also). ... Your GPO settings do not apply to your Terminal Server. ...
    (microsoft.public.windows.terminal_services)
  • Re: Missing Folders in Documents & Settings for New Users
    ... I renamed the default administrator account <SNIP> I ... Settings folder name, and ProfileImagePath value. ... that you have decided to use, choose Rename, and rename the <user ...
    (microsoft.public.windowsxp.customize)