我有一个自定义.wpp.targets文件,它设置一些ACL.当从visual studio中构建时,生成的源清单文件包含自定义ACL.
当我从构建服务器运行时,它不起作用.生成的文件不包含.wpp.targets文件中的acl.
构建服务器安装了.net框架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 ('' != '').
您可以更改参数WebPublishPipelineProjectName. MSBuild默认找到(MSBuildProject).wpp.targets,例如MyProject.wpp.targets.尝试设置/ p:WebPublishPipelineProjectName = MyProject
原文链接:https://www.f2er.com/windows/363742.html我希望这可以帮助你