msbuild-buildengine

how to replace string in file using msbuild?

*爱你&永不变心* 提交于 2019-12-17 09:35:54
问题 I want to replace a string such "how r u" in file test.xml with a string "i am fine" in another file xy.xml.using regular expression in ms build. ie i have to read string from one file(xy.xml) and replace it in another file test.xml. so please provide necessary steps to solve this issue with example 回答1: EDIT: This answer is obsolete. Use solution below... Use ReadLinesFromFile task to get replacement string from the xy.xml file. Check this Then use value from xy.xml as a replacement string

MSBuild: define subprojects build configuration in BuildEngine

送分小仙女□ 提交于 2019-12-11 10:02:45
问题 I'm using BuildEngine as a step to create a one click build environment. The code is the following: Engine engine = new Engine(); FileLogger logger = new FileLogger { Parameters = @"logfile=C:\builds\build.log" }; engine.RegisterLogger(logger); var project = new Project(engine); project.Load("Example.csproj"); project.SetProperty("Configuration", "Release"); bool success = project.Build(); And he seems to build project Example with release configuration. But when I look at the build.log, all

Microsoft.Build.BuildEngine.Engine throws error when building WPF application

风流意气都作罢 提交于 2019-12-11 00:49:38
问题 I am using Microsoft.Build.BuildEngine.Engine to build a WPF application. This has been working successfully for class libraries and web applications, but now trying to use it to build a WPF application I am getting the following error: Target MarkupCompilePass1: c:\Windows\Microsoft.NET\Framework\v3.5\Microsoft.WinFX.targets(294,9): error MC1000: Unknown build error, 'API restriction: The assembly 'file:///C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0\PresentationCore

Evaluate item defined in msbuild task via C#

给你一囗甜甜゛ 提交于 2019-12-02 03:06:35
问题 I am trying to generate a directed graph (dot format) of targets that will be called with an MSBuild project file path as an input. This is same as grand-ui from ggtools.net (except that I'm trying for a read only image to start with). There are 3 cases that I wish to handle: 1) A target has the DependsOnTargets attribute 2) A target calls MSBuild using the Exec task 3) A target calls the MSBuild task and passes an ItemGroup I believe I have mostly handled #1 and #2 in the code below. However

how to replace string in file using msbuild?

江枫思渺然 提交于 2019-11-27 08:14:58
I want to replace a string such "how r u" in file test.xml with a string "i am fine" in another file xy.xml.using regular expression in ms build. ie i have to read string from one file(xy.xml) and replace it in another file test.xml. so please provide necessary steps to solve this issue with example EDIT: This answer is obsolete. Use solution below... Use ReadLinesFromFile task to get replacement string from the xy.xml file. Check this Then use value from xy.xml as a replacement string for FileUpdate task. Check this And put it all together ;) This is no longer required... you can now inject C