3

I am adding this item in the ItemGroup in the project wpp.targets file.

<MsDeploySourceManifest Include="setAcl">
    <Path>%windir%\TEMP</Path>
    <setAclUser>IIS_IUSRS</setAclUser>
    <setAclAccess>Read,Write,Modify</setAclAccess>
    <setAclResourceType>Directory</setAclResourceType>
    <AdditionalProviderSettings>setAclUser;setAclResourceType;setAclAccess</AdditionalProviderSettings>
</MsDeploySourceManifest>

and this on the parameter section

<MsDeployDeclareParameters Include="TempFolderPermissionSetAclParam">
    <Kind>ProviderPath</Kind>
    <Scope>setAcl</Scope>
    <Description>Add read, write permission for IIS_IUSRS to the temp folder.</Description>
    <DefaultValue>%windir%\TEMP</DefaultValue>
    <Value>%windir%\TEMP</Value>
    <Tags>Hidden</Tags>
    <Priority>$(VsSetAclPriority)</Priority>
    <ExcludeFromSetParameter>True</ExcludeFromSetParameter>
  </MsDeployDeclareParameters>

it generate this line in the manifest xml file

but there is an error message says: Error: A value for the 'setAclUser' setting must be specified when the 'setAcl' provider is used with a physical path.

what's missing here?

4

1 回答 1

0

你问这个已经有一段时间了,但从表面上看,这看起来或多或少是正确的:指定绝对路径的关键是在 AdditionalProviderSettings 中包含 setAclUser,以及 setAclUser 的元素。

最终,虽然您的 SourceManifest 文件在您构建包时可能看起来正确,但似乎重要的是包含在创建的 zip 中的 archive.xml 文件中的 setAcl 元素上的 setAclUser 设置。打开它并确保存在您期望的 setAclUser 值。

同样,Visual Studio 在涉及 MSBuild 文件的地方自由地使用缓存。实际上,Visual Studio 似乎只会尊重对 pubxml 文件和项目文件(如 csproj)所做的更改。对任何其他目标文件进行更改时,应关闭 Visual Studio 并在每次编辑后重新打开。这可以解释为什么您看似正确的解决方案不起作用:它可能只是过时的目标文件缓存。

于 2015-03-18T22:10:39.987 回答