I have a web application (ASP.NET MVC 1.0) that uses an external/3rd party. This 3rd party library creates a directory/file for logging purposes. However, I am getting a runtime server error:

Cannot create directory 'C:/temp/Logs'. Cannot create a file when that file already exists. System error code = 183

This log location is specified in the Web.Config. This error is a bit misleading, because that folder does not already exist. It should be noted that c:\temp does in fact exist, but not c:\temp\logs. I also went ahead and created the final subdir, c:\temp\logs, and I get the same problem. I suspect this is actually a permissions problem, so I have:

1) Changed the pool identity of the application pool to Network Service

2) Gave Network Service permissions against c:\temp and also c:\temp\logs when I tested w/ the directory present. I tried basic read/write permissions, as well as "full control" permissions.

3) Tried c:\temp as the log folder

4) Tried the root of the website as the path for the logs folder

5) Tried simply c:\ for the root of the log folder

Same error. What on earth am I doing wrong here? This same 3rd party library is working fine on our IIS6 server, as well as my local computer (IIS5.1).

EDIT: This website exists as a "virtual application" under the "default website" of IIS7. No other websites actually exist on the server.

link|improve this question
Is that log entry copied and pasted verbatim? Because it has forward slashes instead of backslashes in the path. – RainyRat Dec 14 '09 at 19:25
Yeah, I simplified it for the post. Interestingly, I tried it as listed above, and it didn't work. Then changed to c:\temp\Logs, and it worked. I then changed it back to the above, c:/temp/logs, and it works still, even with an app pool recycle. – Orion Dec 14 '09 at 19:44
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown