1

I am not able to understand this behavior: The item group is placed directly under project tag works fine:

 <ItemGroup>
    <!-- Copy the Dev Config files -->  
<Robocopy Include="$(INETROOT)\private\CASI\Reporting\Config\Dev">
      <DestinationFolder>$(DevBranch)\Reporting</DestinationFolder>
      <FileMatch>*</FileMatch>
</Robocopy>

But When the same is included as child to a target, the item group doesnt get executed:

<!-- Create the Dev Branch -->
<Target Name="CreateDevBranch" AfterTargets="Build">
    <CreateItem Include="$(AppRoot)\**\*.*">
        <Output TaskParameter="Include" ItemName="CompileOutput" />
    </CreateItem>

<Copy SourceFiles="@(CompileOutput)" 
    DestinationFolder="$(DevBranch)\hello\%(RecursiveDir)"></Copy>
    <ItemGroup>
    <!-- Copy the Dev Config files -->  
<Robocopy Include="$(INETROOT)\private\CASI\Reporting\Config\Dev">
      <DestinationFolder>$(DevBranch)\Reporting</DestinationFolder>
      <FileMatch>*</FileMatch>
</Robocopy>

</Target>

The strange thing is the copy operation is works and even if i comment the copy operation, the ItemGroup operation still doesnt gets executed

I think I am missing some concept here

Thanks

surya
  • 991
  • 1
  • 12
  • 22

1 Answers1

0

The itemgroup is probably empty, id check to see if the item group you created has any values? Also createitem is old msbuild and the task is decreated with msbuild 3.5. create an item group using

James Woolfenden
  • 6,498
  • 33
  • 53