我正在尝试使用webdeploy应用自定义ACL(将Write
权限设置为文件夹 - 该文件夹为空但已添加到项目中并正确部署)。
我正在使用以下命令行在CI服务器上构建VS解决方案:
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild.exe"
/consoleloggerparameters:ErrorsOnly
/maxcpucount
/nologo
/property:Configuration=Release
/p:Platform=x86
/verbosity:quiet
MySolution.sln
/p:DeployOnBuild=True
/p:PublishProfile="ci"
/p:ProfileTransformWebConfigEnabled=False
/p:WebPublishPipelineCustomizeTargetFile="MyProject\MyProject.wpp.targets"
它正确构建但完全忽略了我MyProject.wpp.targets
的内容。我试图编写错误的XML,但它被默默地忽略,构建成功,但显然没有应用wpp.targets
。 /p:WebPublishPipelineCustomizeTargetFile
参数没有任何效果。
这是MyProject.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)\Content\cache</Path>
<setAclAccess>Read,Write</setAclAccess>
<setAclResourceType>Directory</setAclResourceType>
<AdditionalProviderSettings>setAclResourceType;setAclAccess</AdditionalProviderSettings>
</MsDeploySourceManifest>
</ItemGroup>
</Target>
<Target Name="DeclareCustomParameters" AfterTargets="AddIisAndContentDeclareParametersItems">
<ItemGroup>
<MsDeployDeclareParameters Include="ContentCacheSetAclParam">
<Kind>ProviderPath</Kind>
<Scope>setAcl</Scope>
<Match>^$(_EscapeRegEx_MSDeployDirPath)\\Content\\cache$</Match>
<Description>Add write permission to the Content/cache folder.</Description>
<DefaultValue>{$(_MsDeployParameterNameForContentPath)}/Content/cache</DefaultValue>
<Value>$(_DestinationContentPath)/Content/cache</Value>
<Tags>Hidden</Tags>
<Priority>$(VsSetAclPriority)</Priority>
<ExcludeFromSetParameter>True</ExcludeFromSetParameter>
</MsDeployDeclareParameters>
</ItemGroup>
</Target>
</Project>
该项目是net641
csproj <Project Sdk="Microsoft.NET.Sdk.Web">
。
我的配置有什么问题?谢谢你的帮助。