0

我正在使用http://msdn.microsoft.com/en-us/library/cc826178.aspx指令开发 VisualStudio 2012 扩展。

在本地一切正常。

但是当我尝试使用 TFS 构建此解决方案时,我收到此错误:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\VSSDK\Microsoft.VsSDK.targets (991):压缩错误:无法创建压缩文件 C:\Builds\1\1CMobileClient\Release\Sources \来源\<..>.zip。

服务器:TFS 2012 + VS 2012 SDK

TFS 日志部分:

14:49:07.238 3>从项目“C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\VSSDK\Microsoft.VsSDK.targets”文件中定位“CalculateZipFiles: (TargetId:77)” C:\Builds\1\<..>.csproj”(目标“ZipProjects”取决于它):由于错误条件,任务“CalculateZipItems”被跳过;('%(ZipProject.RootPath)'!='' AND '@(ZipProject)' != '') 被评估为 (''!='' AND 'Templates\Projects\HelloWorldMobileApp\MobileApp.vstemplate;Templates\Projects \HelloWorldMobileApp\Форма.xml;Templates\Projects\HelloWorldMobileApp\Configuration.xml;Templates\Projects\HelloWorldMobileApp__TemplateIcon.ico;Templates\Projects\HelloWorldMobileApp\ФормаМодуль.cs;Templates\Projects\HelloWorldMobileApp\Главный.bp; Templates\Projects\HelloWorldMobileApp\MobileApp.mobproj;Templates\Projects\MobileApp\MobileApp.vstemplate;Templates\Projects\MobileApp\Configuration.xml;Templates\Projects\MobileApp\Главный.bp;Templates\Projects\MobileApp\MobileApp.mobproj;模板\项目\MobileApp__TemplateIcon.ico'!='')。使用程序集“C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\VSSDK\Microsoft.VsSDK.Build.Tasks.dll”中的“CalculateZipItems”任务。任务“CalculateZipItems”(TaskId:43)完成执行任务“CalculateZipItems”。(TaskId:43) 任务“CalculateZipItems” (TaskId:44) 完成执行任务“CalculateZipItems”。(TaskId:44) 任务“CalculateZipItems”被跳过,由于错误的条件;('%(ZipItem.RootPath)'!='' AND '@(ZipItem)' != '') 被评估为 (''!='' AND 'Templates\Items\Process\Process.vstemplate;Templates\Items \Process\Процесс.bp;Templates\Items\Process__TemplateIcon.ico' != '')。任务“CalculateZipItems”(TaskId:45)完成执行任务“CalculateZipItems”。(TaskId:45)14:49:07.240 3>在项目“<...>Project.csproj”中完成构建目标“CalculateZipFiles”。:(TargetId:77)14:49:07.240 3>目标“ZipProjects:(TargetId :78)”在文件“C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\VSSDK\Microsoft.VsSDK.targets”中,来自项目“C:\Builds\1\1CMobileClient\Release\Sources\来源\<...>.csproj" (目标“PrepareForRun”取决于它):任务“消息”(TaskId:46)压缩项目模板(TaskId:46)完成执行任务“消息”。(TaskId:46) 任务“ZipItems”由于错误条件而被跳过;('%(_ZipProject.RootPath)'!='' AND '@(_ZipProject)' != '') 被评估为 (''!='' AND 'Templates\Projects\HelloWorldMobileApp\MobileApp.vstemplate;Templates\Projects \HelloWorldMobileApp\Форма.xml;Templates\Projects\HelloWorldMobileApp\Configuration.xml;Templates\Projects\HelloWorldMobileApp__TemplateIcon.ico;Templates\Projects\HelloWorldMobileApp\ФормаМодуль.cs;Templates\Projects\HelloWorldMobileApp\Главный.bp;Templates\Projects\HelloWorldMobileApp \MobileApp.mobproj'!='')。由于错误条件,任务“ZipItems”被跳过;('%(_ZipProject.RootPath)'!='' AND '@(_ZipProject)' != '') 被评估为 (''!='' AND 'Templates\Projects\MobileApp\MobileApp.vstemplate;Templates\Projects \MobileApp\Configuration.xml;Templates\Projects\MobileApp\Главный.bp;Templates\Projects\MobileApp\MobileApp.mobproj;Templates\Projects\MobileApp__TemplateIcon.ico' != '')。使用程序集“C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\VSSDK\Microsoft.VsSDK.Build.Tasks.dll”中的“ZipItems”任务。任务“ZipItems”(TaskId:47) 压缩 C:\Builds\1\1CMobileClient\Release\Sources\Sources\<..>\obj\Release\HelloWorldMobileApp.zip... (TaskId:47) 14:49:07 . 253 3>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\VSSDK\Microsoft.VsSDK.targets(991,5): 错误:压缩错误:无法创建压缩文件 C:\Builds\ 1\1CMobileClient\Release\Sources\Sources\<..>\obj\Release\HelloWorldMobileApp.zip。完成执行任务“ZipItems”——失败。(任务编号:47)

目标:

<Target Name="ZipProjects"
         DependsOnTargets="$(ZipFilesDependsOn)"
         Condition="'@(_ZipProject)' != '_'">
    <Message Text="Zipping ProjectTemplates"/>
    <!--
      There are 2 options for using this task:
        1) specifying a rootpath on each item
        2) using the directory of the item as the rootpath

      Note: the name of the zip file will be based on the rootpath
    -->
    <!--Project using RootPath-->
    <ZipItems
        Condition="'%(_ZipProject.RootPath)'!='' AND '@(_ZipProject)' != ''"
        Files="@(_ZipProject)"
        Action="New"
        OutputSubPath="%(_ZipProject.OutputSubPath)"
        Culture="%(_ZipProject.Culture)"
        ProjectPath="$(MSBuildProjectDirectory)"
        RootPath="$(MSBuildProjectDirectory)\%(_ZipProject.RootPath)"
        ZipDefaultLanguage="$(VsTemplateLanguage)"
        ZipLanguage="%(_ZipProject.Language)"
        ZipFile="%(_ZipProject.ZipFile)">
      <Output TaskParameter="ZipFile" ItemName="IntermediateZipProject"/>
      <Output TaskParameter="ZipFile" ItemName="FileWrites"/>
    </ZipItems>

    <!--Project using Directory-->
    <ZipItems
        Condition="'%(_ZipProject.RootPath)'=='' AND '@(_ZipProject)' != ''"
        Files="@(_ZipProject)"
        Action="New"
        OutputSubPath="%(_ZipProject.OutputSubPath)"
        Culture="%(_ZipProject.Culture)"
        ProjectPath="$(MSBuildProjectDirectory)"
        RootPath="%(_ZipProject.RootDir)%(_ZipProject.Directory)"
        ZipDefaultLanguage="$(VsTemplateLanguage)"
        ZipLanguage="%(_ZipProject.Language)"
        ZipFile="%(_ZipProject.ZipFile)">
      <Output TaskParameter="ZipFile" ItemName="IntermediateZipProject"/>
      <Output TaskParameter="ZipFile" ItemName="FileWrites"/>
    </ZipItems>

    <!--
      Copy the generated templates to the deployment folder.
    -->
    <Copy SourceFiles="@(IntermediateZipProject)"
          DestinationFiles="@(IntermediateZipProject->'$(ZipProjectOutput)\%(Language)\%(OutputSubPath)\%(Culture)\%(FileName)%(Extension)')"
          SkipUnchangedFiles="true"
          OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
          Retries="$(CopyRetryCount)"
          RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
          Condition="'$(DeployVSTemplates)'=='true'" />

    <!--
      Copy the generated templates to the output folder.
    -->
    <Copy SourceFiles="@(IntermediateZipProject)"
          DestinationFiles="@(IntermediateZipProject->'$(OutDir)\ProjectTemplates\%(Language)\%(OutputSubPath)\%(Culture)\%(FileName)%(Extension)')"
          SkipUnchangedFiles="true"
          OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
          Retries="$(CopyRetryCount)"
          RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
          Condition="'$(CopyZipOutputToOutputDirectory)'=='true'" >
      <Output TaskParameter="DestinationFiles" ItemName="_ZipProjectOutDir"/>
      <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
    </Copy>

    <Message Importance="High" Text="$(MSBuildProjectName) -&gt; @(_ZipProjectOutDir->'%(FullPath)')" />

  </Target>

  <Target Name="ZipItems"
          DependsOnTargets="$(ZipFilesDependsOn)"
          Condition="'@(_ZipItem)' != '_'">

    <Message Text="Zipping ItemTemplates"/>

    <!--
      There are 2 options for using this task:
        1) specifying a rootpath on each item
        2) using the directory of the item as the rootpath

      Note: the name of the zip file will be based on the rootpath
    -->

    <!--Item using RootPath-->
    <ZipItems
        Condition="'%(_ZipItem.RootPath)'!='' AND '@(_ZipItem)' != ''"
        Files="@(_ZipItem)"
        Action="New"
        OutputSubPath="%(_ZipItem.OutputSubPath)"
        Culture="%(_ZipItem.Culture)"
        ProjectPath="$(MSBuildProjectDirectory)"
        RootPath="$(MSBuildProjectDirectory)\%(_ZipItem.RootPath)"
        ZipDefaultLanguage="$(VsTemplateLanguage)"
        ZipLanguage="%(_ZipItem.Language)"
        ZipFile="%(_ZipItem.ZipFile)">
      <Output TaskParameter="ZipFile" ItemName="IntermediateZipItem"/>
      <Output TaskParameter="ZipFile" ItemName="FileWrites"/>
    </ZipItems>

    <!--Item using Directory-->
    <ZipItems
        Condition="'%(_ZipItem.RootPath)'=='' AND '@(_ZipItem)' != ''"
        Files="@(_ZipItem)"
        Action="New"
        OutputSubPath="%(_ZipItem.OutputSubPath)"
        Culture="%(_ZipItem.Culture)"
        ProjectPath="$(MSBuildProjectDirectory)"
        RootPath="%(_ZipItem.RootDir)%(_ZipItem.Directory)"
        ZipDefaultLanguage="$(VsTemplateLanguage)"
        ZipLanguage="%(_ZipItem.Language)"
        ZipFile="%(_ZipItem.ZipFile)">
      <Output TaskParameter="ZipFile" ItemName="IntermediateZipItem"/>
      <Output TaskParameter="ZipFile" ItemName="FileWrites"/>
    </ZipItems>

    <!--
      Copy the generated templates to the deployment folder.
    -->
    <Copy SourceFiles="@(IntermediateZipItem)"
          DestinationFiles="@(IntermediateZipItem->'$(ZipItemOutput)\%(Language)\%(OutputSubPath)\%(Culture)\%(FileName)%(Extension)')"
          SkipUnchangedFiles="true"
          OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
          Retries="$(CopyRetryCount)"
          RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
          Condition="'$(DeployVSTemplates)'=='true'" />

    <!--
      Copy the generated templates to the output folder.
    -->
    <Copy SourceFiles="@(IntermediateZipItem)"
          DestinationFiles="@(IntermediateZipItem->'$(OutDir)\ItemTemplates\%(Language)\%(OutputSubPath)\%(Culture)\%(FileName)%(Extension)')"
          SkipUnchangedFiles="true"
          OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
          Retries="$(CopyRetryCount)"
          RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
          Condition="'$(CopyZipOutputToOutputDirectory)'=='true'" >
      <Output TaskParameter="DestinationFiles" ItemName="_ZipItemOutDir"/>
      <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
    </Copy>

    <Message Importance="High" Text="$(MSBuildProjectName) -&gt; @(_ZipItemOutDir->'%(FullPath)')" />

  </Target>
4

0 回答 0