11
我創建了一個build.proj文件,其中包含一個任務,複製將在生成完成後生成的文件。問題在於這些文件在第一次複製時不會被複制,我必須在build.proj上再次運行msbuild,以便可以複製這些文件。請任何人都可以告訴我什麼是錯誤的以下build.proj文件:MSBuild複製任務不復制文件的第一次
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<SourcePath Condition="'$(SourcePath)' == ''">$(MSBuildProjectDirectory)</SourcePath>
<BuildDir>$(SourcePath)\build</BuildDir>
</PropertyGroup>
<ItemGroup>
<Projects
Include="$(SourcePath)\src\myApp\application.csproj">
</Projects>
</ItemGroup>
<Target Name="Build">
<Message text = "Building project" />
<MSBuild
Projects="@(Projects)"
Properties="Configuration=$(Configuration)" />
</Target>
<ItemGroup>
<OutputFiles Include ="$(MSBuildProjectDirectory)\**\**\bin\Debug\*.*"/>
</ItemGroup>
<Target Name="CopyToBuildFolder">
<Message text = "Copying build items" />
<Copy SourceFiles="@(OutputFiles)" DestinationFolder="$(BuildDir)"/>
</Target>
<Target Name="All"
DependsOnTargets="Build; CopyToBuildFolder"/>
</Project>
內添加CreateItem標籤修正你的代碼的縮進請,這是不可理解的。 – 2009-03-03 14:40:48
對不起插入腳本有點麻煩......現在一切都已排序 – Draco 2009-03-03 15:23:09