我通過Visual Studio的部署彈性魔豆2013wpp.targets改變文件夾的權限 - 只有第一個文件夾權限應用於
這裏是我的wpp.targets文件:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="SetupCustomAcls" AfterTargets="AddIisSettingAndFileContentsToSourceManifest">
<ItemGroup>
<MsDeploySourceManifest Include="setAcl">
<Path>$(_MSDeployDirPath_FullPath)\ChatFiles</Path>
<setAclAccess>Read,Write</setAclAccess>
<setAclResourceType>Directory</setAclResourceType>
<AdditionalProviderSettings>setAclResourceType;setAclAccess</AdditionalProviderSettings>
</MsDeploySourceManifest>
<MsDeploySourceManifest Include="setAcl">
<Path>$(_MSDeployDirPath_FullPath)\FileHoldingForS3</Path>
<setAclAccess>Read,Write</setAclAccess>
<setAclResourceType>Directory</setAclResourceType>
<AdditionalProviderSettings>setAclResourceType;setAclAccess</AdditionalProviderSettings>
</MsDeploySourceManifest>
<MsDeploySourceManifest Include="setAcl">
<Path>$(_MSDeployDirPath_FullPath)\FileHoldEmail</Path>
<setAclAccess>Read,Write</setAclAccess>
<setAclResourceType>Directory</setAclResourceType>
<AdditionalProviderSettings>setAclResourceType;setAclAccess</AdditionalProviderSettings>
</MsDeploySourceManifest>
</ItemGroup>
</Target>
<Target Name="DeclareCustomParameters" AfterTargets="AddIisAndContentDeclareParametersItems">
<ItemGroup>
<MsDeployDeclareParameters Include="FilesSetAclParam">
<Kind>ProviderPath</Kind>
<Scope>setAcl</Scope>
<Match>^$(_EscapeRegEx_MSDeployDirPath)\\ChatFiles$</Match>
<Description>Add write permission to the ChatFiles folder.</Description>
<DefaultValue>{$(_MsDeployParameterNameForContentPath)}/ChatFiles</DefaultValue>
<Value>$(_DestinationContentPath)/ChatFiles</Value>
<Tags>Hidden</Tags>
<Priority>$(VsSetAclPriority)</Priority>
<ExcludeFromSetParameter>True</ExcludeFromSetParameter>
</MsDeployDeclareParameters>
<MsDeployDeclareParameters Include="FilesSetAclParam">
<Kind>ProviderPath</Kind>
<Scope>setAcl</Scope>
<Match>^$(_EscapeRegEx_MSDeployDirPath)\\FileHoldingForS3$</Match>
<Description>Add write permission to the FileHoldingForS3 folder.</Description>
<DefaultValue>{$(_MsDeployParameterNameForContentPath)}/FileHoldingForS3</DefaultValue>
<Value>$(_DestinationContentPath)/FileHoldingForS3</Value>
<Tags>Hidden</Tags>
<Priority>$(VsSetAclPriority)</Priority>
<ExcludeFromSetParameter>True</ExcludeFromSetParameter>
</MsDeployDeclareParameters>
<MsDeployDeclareParameters Include="FilesSetAclParam">
<Kind>ProviderPath</Kind>
<Scope>setAcl</Scope>
<Match>^$(_EscapeRegEx_MSDeployDirPath)\\FileHoldEmail$</Match>
<Description>Add write permission to the FileHoldEmail folder.</Description>
<DefaultValue>{$(_MsDeployParameterNameForContentPath)}/FileHoldEmail</DefaultValue>
<Value>$(_DestinationContentPath)/FileHoldEmail</Value>
<Tags>Hidden</Tags>
<Priority>$(VsSetAclPriority)</Priority>
<ExcludeFromSetParameter>True</ExcludeFromSetParameter>
</MsDeployDeclareParameters>
</ItemGroup>
</Target>
但僅應用第一個文件夾的文件夾權限。
我確保wapp.targets文件在部署之前不被緩存。
謝謝 - 不,這對我來說沒問題。 – SSED