| siva 的个人资料siva's space照片日志列表 | 帮助 |
|
|
8月21日 MSBuild Community Tasks: How to replace text in multiple files using MSBuildHi,
I have requirement to replace a string "<VIRTUAL>" with "DEFAULT" in all solution files under source directory.
This can be done easily using FileUpdate task of MSBuild communtity tasks. Here is sample code.
First we need to import MSBuild community tasks into our project.
< Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" InitialTargets="ReplaceText"><Import Project="MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/> < ItemGroup><FILES Include="$(MSBuFildProjectDirectory)\..\Source\**\*.sln" /> </ItemGroup> < Target Name="ReplaceText"><FileUpdate Files="@(FILES)" Regex="<VIRTUAL>" ReplacementText="DEFAULT" /> </Target> </ Project>-Siva 引用通告此日志的引用通告 URL 是: http://sivapinnaka.spaces.live.com/blog/cns!B027EF7E7070AD69!225.trak 引用此项的网络日志
|
|
|