How can I stop Visual Studio Web Publish from deleting write permissions from my target website?

I have a web application (actually Orchard CMS) that I am setting up and I want to push directl from my build server to the hosting provider using web publishing as well as MSDeploy.

The problem is that when I publish the site (from Visual Studio, I have not tried it from the build server yet), it removes the write permission from the target website, which makes Orchard instantly crash because it can no longer access it database (etc.).

We can discuss this wisdom, but the bottom line is that Orchard requires write access, and web publishing insists on removing that access, which crashes the site. Not good. I need to enter the control panel of the service provider and reset the permissions every time I publish, which makes the process less automatic.

So, how do I get Web Publishing to leave the ACL alone? I can not find any settings for this anywhere.

Thanks, --Tim

+7
source share
2 answers

You can add to disable the ACL configuration function by adding this to the .pubxml file:

<IncludeSetACLProviderOnDestination>False</IncludeSetACLProviderOnDestination> 

See http://msdn.microsoft.com/en-us/library/ff398069.aspx

+13
source

In some cases, you may find that after publishing a project using ASPNet web deployment, IUSR cannot write to the root directory or any files inside it (except App_Data).

By default, Web Deploy sets the read-only ACL for ASP.NET IUSR. So that this does not cause problems when publishing your application, you need to find the project file and make some changes. The project file will end with the extension .vbproj for applications written in Visual Basic or .csproj for applications written in C #. In the project file, find:

 <propertygroup condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "></propertygroup> 

and change it to:

 <propertygroup condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <includesetaclproviderondestination>False</includesetaclproviderondestination> </propertygroup> 

This ensures that the ACL will not be modified by Web Deploy.

If you have already deployed a third-party hosting provider, you may need to contact them to obtain your reset permissions before performing another deployment.

+1
source

All Articles