wpp.targets更改文件夹权限 - 仅应用第一个文件夹权限

时间:2016-03-21 16:26:08

标签: visual-studio amazon-ec2 msdeploy webdeploy

我正在通过Visual Studio 2013部署到弹性beanstalk。

这是我的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> 

但只应用了第一个文件夹的文件夹权限。

我确保在部署之前没有缓存wpp.targets文件。

2 个答案:

答案 0 :(得分:1)

确保您没有通过MSDeploy.exe调用指示MSDeploy忽略ACL

,includeAcls="False"

或者在构建中:

http://blogs.iis.net/msdeploy/skipping-setting-an-acl-in-a-visual-studio-2010-deployment-package

答案 1 :(得分:0)

问题在于每个人:

https://graph.facebook.com/me/friends?access_token=[ACCESS_TOKEN]&fields=name,gender,picture.width(1000)

FilesSetAclParam对每一个都应该是唯一的(当然!)