Hithere Paperbag
Hithere Paperbag

Reputation: 2808

What is the path of the root directory on IIS server?

I'm attempting to write to a logfile, but File.Write(path, string) is not giving me access.

This is the error message:

Access to the path 'C:\Windows\SysWOW64\inetsrv\20130213190451765 49cb4a74-de61-49e5-93de-94d982073f89.txt' is denied.

Upvotes: 0

Views: 2838

Answers (1)

spender
spender

Reputation: 120450

The path is given via Server.MapPath("~"). I'd advise against making the root folder of your site writeable in most cases. Why not choose a different, isolated location and give write permission to your app pool identity for that location?

Upvotes: 1

Related Questions