Setting Custom Folder Permissions during Web Deployment

After introducing Elmah error logging to a web site, you could be confronted by the need to set permissions on the log output  folder during deployment.  You can avoid the permissions problem by directing the log output to the App_Data folder in your site directory as long as you have an App_Data folder. This is because the permissions are automatically set for App_Data when deploying with MSDeploy.

Let’s say that you want the logs to be placed in another folder such as Elmah or Logs, then you do need to give write permissions to the application pool that your site is running under.

custom folder permissions scriptYou could just script the folder permissions and it would not be too hard, but what if you wanted to have it done as part of the deployment process. I discovered a customization that does this. It is based on the same process to set permissions as App_Data. It involves adding an MSBuild project and configuration and it is explained in detail by Sayed Ibrahim Hashimi.

Tagged with:
Posted in Development
One comment on “Setting Custom Folder Permissions during Web Deployment
  1. Alex says:

    Your customization link is broken. Just need to an an “x” at the end of url. So that is becomes .aspx instead .asp as it currently is.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: