We already have build scripts that creates our web applicatio开发者_如何学Cn folders very nicely. We create multiple folders for each environment, and then change the configs in those folders according to the environment.
How can we get the same results as what _CopyWebApplication does?
Example:
<MSBuild Projects="$(SourceCodeCheckoutFolder)\source\UI\$(ProjectName)\$(ProjectName).csproj"
Targets="ResolveReferences; ResolveProjectReferences;_CopyWebApplication"
ToolsVersion="3.5"
StopOnFirstFailure="False"
RunEachTargetSeparately="False"
</MSBuild>
It seems that there is no such a thing. And that most people just use the Copy tasks in msbuild
<Target Name="CreateFolderAndCopyCompiledCode">
<ItemGroup>
<FilesToCopy Include="SourceOfCompilation\\*.*" />
</ItemGroup>
<MakeDir Directories="CodeDestination">
<Output TaskParameter="DirectoriesCreated" PropertyName="BuildOutputDir" />
</MakeDir>
<Copy SourceFiles="@(FilesToCopy)" DestinationFolder="CodeDestination" ContinueOnError="True" /></Target>
I found that removing the targets has the correct behavoir, another lesson about less is more :)
<MSBuild Projects="$(ProjectName).csproj"
</MSBuild>
精彩评论