If you want to create a folder available on your website, you can put the following snippet in your "PostBuild" events at the very bottom of your .csproj (you need to manually edit the .csproj file through a text editor)
<Target Name="AfterBuild"> <Exec Command=" icacls ".\Logs" /grant Users:(CI)(OI)M /T " ContinueOnError="true" />ฯ <Exec Command=" icacls ".\Logs" /grant IIS_IUSRS:(CI)(OI)M /T " ContinueOnError="true" /> </Target>
Sidenote: if you use the publish / deploy function on a remote visual studio server to deploy your website, then it goes without saying that folder permissions will probably NOT be saved and that you will have to use some after installing the script to re apply them (maybe use the icacls method again). This type of post-installation script should probably be part of WebDeploy - it didnโt use WebDeploy, so your mileage may vary depending on the specific aspect.
source share