When publishing with Web Deploy in conjunction with Visual Studio it can alter the account’s ACL permissions on your web space.
Sometimes this actually removes Execute permissions as well which will prevent ASP.NET files from running with the following error. Basically it has removed permissions so the compiler cannot run:
[Win32Exception (0x80004005): Access is denied]
To stop this behaviour please edit your publishing profile to include:
<IncludeSetACLProviderOnDestination>False</IncludeSetACLProviderOnDestination>
To do this go to Solutions Explorer under your project in Visual Studio:
- Expand Properties > PublishProfiles.
- Double click the "yoursite - Web Deploy.pubxml" file.
- Add the tag above set to false within the <PropertyGroup> section.
- Save the file.
Now when you publish the ACLs will not be tampered with.
If they already have been broken and you need to fix them to remove the error then simply:
- Login to your hosting CP.
- Websites > Click your websites domain.
- Click the checkbox "Enable Write Permissions".
- Click Save.
You can also follow the guide from Microsoft linked below in order to do this:
https://docs.microsoft.com/en-us/previous-versions/aspnet/ff398069(v=vs.110)