我有一个自定义.wpp.targets文件,它正在设置一些ACL。当我在visual studio中构建时,生成的源清单文件包含自定义ACL。
当我从构建服务器运行时,它只是不起作用。生成的文件不包含.wpp.targets文件中的acl。
构建服务器安装了.net framework 4,Web部署,它具有正确的Microsoft.Web.Publishing.targets文件。我在服务器上的构建中包含了一些诊断,其中似乎“AfterAddIisSettingAndFileContentsToSourceManifest”属性为false。我不熟悉msbuild。有人可以帮忙吗?
编辑:
我注意到在我的Microsoft.Web.Publishing.targets中有以下几行:
<PropertyGroup>
<WebPublishPipelineCustomizeTargetFile Condition="'$(WebPublishPipelineCustomizeTargetFile)'==''">$(WebPublishPipelineProjectDirectory)\$(WebPublishPipelineProjectName).wpp.targets</WebPublishPipelineCustomizeTargetFile>
</PropertyGroup>
<Import Project="$(WebPublishPipelineCustomizeTargetFile)" Condition="Exists($(WebPublishPipelineCustomizeTargetFile))"/>
然而,msbuild的输出中没有关于webpublishpipeline的内容。我认为我的.wpp.targets文件甚至没有被查看!
目标文件:
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<!--
********************************************************************
Task Custom ACLs
********************************************************************
-->
<PropertyGroup>
<!-- Extends the AfterAddIisSettingAndFileContentsToSourceManifest action to also set ACLs-->
<AfterAddIisSettingAndFileContentsToSourceManifest Condition="'$(AfterAddIisSettingAndFileContentsToSourceManifest)'==''">
$(AfterAddIisSettingAndFileContentsToSourceManifest);
SetCustomACLs;
</AfterAddIisSettingAndFileContentsToSourceManifest>
</PropertyGroup>
<Target Name="SetCustomACLs">
<Message Text="Adding Custom ACls" />
<ItemGroup>
<!--Make sure the by default Networkservice/AppPoolIdentity have write permission to the root-->
<MsDeploySourceManifest Include="setAcl" >
<Path>$(_MSDeployDirPath_FullPath)\bin\ABCpdf8-64.dll</Path>
<setAclAccess>ReadAndExecute</setAclAccess>
<setAclResourceType>File</setAclResourceType>
<AdditionalProviderSettings>setAclResourceType;setAclAccess</AdditionalProviderSettings>
</MsDeploySourceManifest>
</ItemGroup>
</Target>
</Project>
msbuild输出:
[GenerateMsdeployManifestFiles] CallTarget
[22:13:44]: [CallTarget] Target "PipelinePreDeployCopyAllFilesToOneFolder" skipped. Previously built successfully.
[22:13:44]: [CallTarget] Target "GenerateMsDeployManifestSettings" skipped. Previously built successfully.
[22:13:44]: [CallTarget] Target "PipelinePreDeployCopyAllFilesToOneFolder" skipped. Previously built successfully.
[22:13:44]: [CallTarget] Target "GenerateMsDeployManifestSettings" skipped. Previously built successfully.
[22:13:44]: [CallTarget] Target "AddIis7ToSourceManifest" skipped, due to false condition; ($(_DeploymentUseIis) And ($(LocalIisVersion) >= '7')) was evaluated as (False And (7 >= '7')).
[22:13:44]: [CallTarget] Target "AddIis6ToSourceManifest" skipped, due to false condition; ($(_DeploymentUseIis) And ($(LocalIisVersion) < '7') ) was evaluated as (False And (7 < '7') ).
[22:13:44]: [CallTarget] AddContentPathToSourceManifest
[22:13:44]: [AddContentPathToSourceManifest] Using "GetDeployManagedRuntimeVersion" task from assembly "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll".
[22:13:44]: [AddContentPathToSourceManifest] Task "CallTarget" skipped, due to false condition; ('$(AfterAddContentPathToSourceManifest)' != '') was evaluated as ('' != '').
[22:13:44]: [CallTarget] AddIisSettingAndFileContentsToSourceManifest
[22:13:44]: [AddIisSettingAndFileContentsToSourceManifest] Task "CallTarget" skipped, due to false condition; ('$(AfterAddIisSettingAndFileContentsToSourceManifest)' != '') was evaluated as ('' != '').
[22:13:44]: [CallTarget] Target "CollectDatabasesToPublish" skipped, due to false condition; ($(PublishDatabases)) was evaluated as (false).
[22:13:44]: [CallTarget] AddDatabasesToSourceManifest
[22:13:44]: [AddDatabasesToSourceManifest] Task "CallTarget" skipped, due to false condition; ('$(AfterAddDatabasesToSourceManifest)' != '') was evaluated as ('' != '').
[22:13:44]: [CallTarget] WriteItemsToSourceManifest
[22:13:44]: [WriteItemsToSourceManifest] Using "ExportManifestFile" task from assembly "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.Tasks.dll".
[22:13:44]: [WriteItemsToSourceManifest] Task "CallTarget" skipped, due to false condition; ('$(AfterWriteItemsToSourceManifest)' != '') was evaluated as ('' != '').
答案 0 :(得分:4)
您可以更改参数WebPublishPipelineProjectName。 MSBuild默认尝试查找(MSBuildProject).wpp.targets,例如MyProject.wpp.targets。尝试设置/ p:WebPublishPipelineProjectName = MyProject
我希望这有助于你