Msbuild - Output is moved intermittently because of Aestrik (*)

53 Views Asked by At

I am trying to build csproj using msbuild which stores output on the fly and then move it to configured output directory, Simple :). But values passed with aestrik (*) works intermittently however other value get moved always.

Snap of Required Code:-

<ItemGroup>
    <PublisherRunnables Include="$(ProjectDir)$(OutputPath)WebservicePublisher.exe" />
    <PublisherAssamblies Include="$(ProjectDir)$(OutputPath)*.dll" />
    <PublisherConfigs Include="$(ProjectDir)$(OutputPath)Configurations.xml" />

<Target Name="ReorganizeFiles" DependsOnTargets="CopyPackageOutput">
    <Move SourceFiles="@(PublisherRunnables)" DestinationFolder="c:\Builds\_tmp\" />
    <Move SourceFiles="@(PublisherAssamblies)" DestinationFolder="c:\Builds\_tmp\Libs" />
    <Move SourceFiles="@(PublisherConfigs)" DestinationFolder="c:\Builds\_tmp\" />
  </Target>

output - First time i build project Results-

WebservicePublisher.exe
Configurations.xml
None of the dll's are moved 

Second time i build project Results -

WebservicePublisher.exe
Configurations.xml
All required dll's are moved 

Note - No issue with build order, if i specify specific dll rather than *.dll , it works every time.

0

There are 0 best solutions below