Skip to main content Skip to footer

How to stop Web Deploy resetting file permissions

When deploying, the Web Deploy tool can reset your file permissions on the destination server.

Thankfully the fix for this is fairly simple with two options.

The options may vary slightly between .NET Core (.NET 5+) and .NET Framework, but I have been able to successfully use them with both.

Method 1 - Edit your projects csproj file

.NET Framework

Find to target the release build search for the following line:

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

To target the debug build, search for the following line:

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

Immediately after the line, insert the following:

<includesetaclproviderondestination>False</includesetaclproviderondestination>

.NET Core / .NET 5+

Find to target the release build search for the following line:

<TargetFramework></TargetFramework>

Immediately after the line, insert the following:

<includesetaclproviderondestination>False</includesetaclproviderondestination>

Method 2 - MSBuild Argument

In your build command, add the below argument:

/p:IncludeSetAclProviderOnDestination=False 

About the author

Aaron Sadler

Aaron Sadler, Umbraco MVP (2x), Umbraco Certified Master Developer and DevOps Engineer

comments powered by Disqus