简体   繁体   中英

Trouble with MSBuild Copy

Hi I have the following target.

<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>

The Message outputs the correct paths but does not do the copy.

The file does not exist.

Wrong variable name. GenerateDuringBuild is for another task. Lesson Learned. Do not copy and paste.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM