[RESOLVED] System.UnauthorizedAccessException
Ok, here's the thing, i have an ASP.NET page that sometimes needs to read other files, images and text files, worked fine on my development pc.. but now i have moved it over to windows server 2003, i get this security error
Exception Details: System.UnauthorizedAccessException: Access to the path "D:\Inetpub\wwwroot\useragree.txt" is denied.
but ASPNET and NETWORK SERVICE and the IUSR account all have read permission to the folder, and that's all i need to do, is read.. not write. This could also be part of my debugging issue im having though (the old, unable to debug, access denied) error, all the old threads i looked up didnt solve my particular problem.
EDIT NOTE: I just tried setting "Everyone" to read access.. still doesnt work, this has to be a .NET problem then right?
Any Ideas?
Re: System.UnauthorizedAccessException
look in the event logs to see what user account it is using.
Also make sure that the integrated Windows Authentication check box is ticked in the IIS website properties.
it's not a .NET issue - its the security in which Windows is denying as it has no access right to give
Re: System.UnauthorizedAccessException
which log files? where would they be?
there is no mention of it in the IIS logs. Windows Auth is ticked.
Re: System.UnauthorizedAccessException
Figured it out, found out user account using security namespace.. and it wasNETWORK SERVICE which had permission.. thing was, when opening a filestream, even though u open a file in "open" mode, if u dont use the next overload where accessmode is specified, it still opens it in read&write mode, so i used the overload to make it readonly, now it works!
thanks for the replies