11

我有一个自定义的 .wpp.targets 文件,它正在设置一些 ACL。当我从 Visual Studio 中构建时,生成的源清单文件包含自定义 ACL。

当我从我的构建服务器运行时,它只是不起作用。生成的文件不包含 .wpp.targets 文件中的 acl。

构建服务器安装了 .net framework 4、web 部署,它具有正确的 Microsoft.Web.Publishing.targets 文件。我在服务器上的构建中包含了一些诊断信息,其中“AfterAddIisSettingAndFileContentsToSourceManifest”属性似乎为假。我不熟悉 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 ('' != '').
4

1 回答 1

5

您可以更改参数 WebPublishPipelineProjectName。默认情况下,MSBuild 会尝试查找 (MSBuildProject).wpp.targets,例如 MyProject.wpp.targets。尝试设置 /p:WebPublishPipelineProjectName=MyProject

我希望这可以帮助你

于 2011-11-15T17:12:24.267 回答