msbuild-task

When implementing a microsoft.build.utilities.task how to i get access to the various environmental variables of the build?

天大地大妈咪最大 提交于 2019-12-22 10:48:10
问题 When implementing a microsoft.build.utilities.task how to i get access to the various environmental variables of the build? For example "TargetPath" I know i can pass it in as part of the task XML <MyTask TargetPath="$(TargetPath)" /> But i don't want to force the consumer of the task to have to do that if I can access the variable in code. http://msdn.microsoft.com/en-us/library/microsoft.build.utilities.task.aspx 回答1: I worked out how to do this public static class BuildEngineExtensions {

How can I execute programs in my %PATH% with MSBuild?

筅森魡賤 提交于 2019-12-22 10:24:08
问题 Note: I'm using Mercurial as an example here, because that's what I'm trying to get to work with MSBuild right now. But the problem is not limited to Mercurial, it happens with every external program that is somewhere in my %PATH% variable (I tried the same with PowerShell, for example). So I didn't put the Mercurial tag on this question on purpose, because this is not about Mercurial! What I actually want to do: I want my build script to get the current revision number from my Mercurial

Use XSD Build task in c# project

删除回忆录丶 提交于 2019-12-22 07:54:08
问题 How can I use the c++ XSD Task in a c# project? I have already created the task in the csproj file like this: <Target Name="BeforeBuild"> <XSD Namespace="$(RootNamespace).Xml" Language="CS" GenerateFromSchema="classes" Sources="Xml/schema.xsd" /> </Target> but the build output says, although intellisense offers me the XSD task while editing the project file: Error 1 The "XSD" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the

How make MSBuild build custom target specified in csproj building sln?

Deadly 提交于 2019-12-22 05:15:12
问题 I am facing an issue with MSBuild I can't overcome it by myself. As a result I rely on community's wisdom. The real situation I'm having troubles with I have a soluiton file containing several projects with dependencies to other projects in same solution. I'd like to append a custom target to one of the project's csproj file and build it from the command line. It will allow me to make all the necessary output binaries for this project for further processing during the building of the custom

MSBuild custom task “Hello World” walkthrough

眉间皱痕 提交于 2019-12-22 04:01:41
问题 Can someone write (or link to) a walkthrough that explains exactly how to create a custom MSBuild task and run it during a build? I'm looking for a custom task that inherits from Microsoft.Build.Utilities.Task and does only this: public override bool Execute() { Log.LogMessage("Hello world!"); return true; } (I've been working on this for hours and keep getting the "The [whatever] task was not found. Check the following" message. I think I must be missing an essential step somewhere. If there

Building a particular revision in Jenkins Pipeline

倖福魔咒の 提交于 2019-12-21 09:15:20
问题 I am using SVN as my source control repository and Jenkins as my CI tool. I run MSBuild scripts using Jenkins to do the actual builds and deploys. I also use the Jenkins Pipeline plugin to do manage the building of downstream projects. I have an issue with the pipeline. The problem is that, say I have done 10 check-ins into SVN and as a result 10 automatic CI builds have taken place, and as a result of that the pipeline shows 10 builds. Now, if I want to push build number 5 to the next stage

How to create MSBuild inline task from multiple source files

浪子不回头ぞ 提交于 2019-12-21 05:07:06
问题 I am having several CS files (one DLL project), all in one directory and one of the classes there extends ITask. Now, it is easy and documented how to create inline task from one source file, but is it possible to do this from multiple source files? I am not able to compile and use DLL as a task and I would prefer if I don't have to cram all sources into one big source file. I am targeting something like: <UsingTask TaskName="foo" TaskFactory="CodeTaskFactory" AssemblyFile="Microsoft.Build

MSBuild TFS Build Number

天涯浪子 提交于 2019-12-20 20:03:56
问题 I have been using SVN for a little while now. recently on a project I am using TFS. With the builds I like to append/update the build version number on the project output. I do this on the masterpage so that it is clearly visible on the application. Since the application could be running on multiple machines, it is handy information on which verison are running. I achive this in SVN world as: <!-- Import of the MSBuildCommunityTask targets --> <Import Project="$(MSBuildExtensionsPath)

How to check if a MSBuild-Task fails if using ContinueOnError=true

☆樱花仙子☆ 提交于 2019-12-20 18:25:27
问题 I am running the MSBuild task with ContinueOnError =true: <MSBuild Projects="@(ComponentToDeploy)" Targets="$(DeploymentTargets)" Properties="$(CommonProperties);%(AdditionalProperties)" ContinueOnError="true" Condition="%(Condition)"/> So my build always succeeds. Is there a way to find out if any error occurs? I could not find any Output of the MSBuild task containing this information. The only way I know is to parse the log file for errors but it looks like a workaround for me. (I am using

How to check if a MSBuild-Task fails if using ContinueOnError=true

我怕爱的太早我们不能终老 提交于 2019-12-20 18:24:43
问题 I am running the MSBuild task with ContinueOnError =true: <MSBuild Projects="@(ComponentToDeploy)" Targets="$(DeploymentTargets)" Properties="$(CommonProperties);%(AdditionalProperties)" ContinueOnError="true" Condition="%(Condition)"/> So my build always succeeds. Is there a way to find out if any error occurs? I could not find any Output of the MSBuild task containing this information. The only way I know is to parse the log file for errors but it looks like a workaround for me. (I am using