开发者

Looking for a target that works like "_CopyWebApplication" but for console apps

开发者 https://www.devze.com 2023-01-01 09:37 出处:网络
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

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

精彩评论

暂无评论...
验证码 换一张
取 消