且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用 msbuild 替换文件中的字符串?

更新时间:2023-02-23 20:28:46

这个答案已经过时了.使用下面的解决方案...

使用 ReadLinesFromFile 任务从 xy.xml 文件中获取替换字符串.检查一下

Use ReadLinesFromFile task to get replacement string from the xy.xml file. Check this

然后使用 xy.xml 中的值作为 FileUpdate 任务的替换字符串.检查一下

Then use value from xy.xml as a replacement string for FileUpdate task. Check this

把它们放在一起;)