MSBuild Copy问题

时间:2013-09-19 10:27:53

标签: visual-studio-2010 msbuild msbuild-task

您好我有以下目标。

<Target
  Name="TestCopy"
  AfterTargets="BeforeBuild"
    >

<Message
    Text="Copying base Sitecore config files @(GenerateDuringBuild) 

        %(GenerateDuringBuild.RootDir)%(GenerateDuringBuild.Directory)UpdatedConfiguration\%(GenerateDuringBuild.Filename)\%(GenerateDuringBuild.Filename)%(GenerateDuringBuild.Extension)


        %(GenerateDuringBuild.RootDir)%(GenerateDuringBuild.Directory)UpdatedConfiguration\%(GenerateDuringBuild.Filename)\%(GenerateDuringBuild.Filename)%(GenerateDuringBuild.Extension).test
      "

        />

 <Copy
    SourceFiles="%(GenerateDuringBuild.RootDir)%(GenerateDuringBuild.Directory)UpdatedConfiguration\%(GenerateDuringBuild.Filename)\%(GenerateDuringBuild.Filename)%(GenerateDuringBuild.Extension)"
    DestinationFiles="%(GenerateDuringBuild.RootDir)%(GenerateDuringBuild.Directory)UpdatedConfiguration\%(GenerateDuringBuild.Filename)\%(GenerateDuringBuild.Filename)%(GenerateDuringBuild.Extension).test"
    Condition="!Exists('%(GenerateDuringBuild.FullPath)')"
    />


</Target>

消息输出正确的路径但不执行复制。

该文件不存在。

1 个答案:

答案 0 :(得分:0)

错误的变量名称。 GenerateDuringBuild用于其他任务。学过的知识。不要复制和粘贴。