msbuild-task

Cruise Control.net Ms Build Task setting XML output Name

We are running version 1.5.6755.1 of CruiseControl.net. Here is our block that executes a build <!-- MSBuild of Source Code --> <cb:define name="BuildOneProject-block"> <msbuild> <executable>C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe</executable> <!-- Directory where source is --> <workingDirectory>D:\...

Use MSBuild to build Entity Framework Model without using the Project File?

I am in the process of build a script for a fairly big project. One of the projects require an Entity Framework Model to be compiled into a library. Due to the way the build server works, all builds are hand crafted to manage the various deployment scenarios without affecting the developers and the project files. Is there anyway to gene...

How do I determine the current operating system version in MSBuild?

Is there a native or custom MSBuild task available that returns the current OS version? Is there a binary that I could call via an Exec task? Or is there some other option? Edit: Peter Lang suggested the following link: http://www.paraesthesia.com/archive/2009/07/06/getting-the-windows-os-version-in-msbuild.aspx ...

Determining outputs of a ProjectReference in MSBuild without triggering redundant rebuilds

As part of a solution containing many projects, I have a project that references (via a <ProjectReference> three other projects in the solution, plus some others). In the AfterBuild, I need to copy the outputs of 3 specific dependent projects to another location. Via various SO answers, etc. the way I settled on to accomplish that was: ...

How to bind a target within MSBuild to a general error.

We are using TFS build and we have a couple of custom steps within the configuration (e.g. running NUnit tests in AfterCompile target, deployment steps in AfterDropBuild target etc.). Now I wanted to add the functionality of sending emails on broken builds. I have configured a mail task from MS Community tasks and put it to the BeforeOnB...

Use XSD Build task in c# project

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

msbuild custom task

I have a custom MSBuild task that takes in a set of JavaScript files, minifies them, and outputs them, with the extension .min.js. When I do a normal build through Visual Studio, it works perfectly and the .min.js files are output to the same directory as the original files. When I try to deploy using the Publish feature in Visual Studio...

MSBuild.ExtensionPack.FileSystem.Folder with TaskAction="RemoveContent" throws IOException: The directory is not empty

Hi guys, I would like to delete all the files and subfolders inside a folder. For this purpose, I am using task in my script with property TaskAction set to "RemoveContent". However there is an inconsistent behaviour. Sometimes when I run the script, it throws IOException with the messsage The directory is not empty. But when i rerun ...

Read attributes of MSBuild custom tasks via events in the Logger

I am trying to write a MSBuild logger module which logs information when receiving TaskStarted events about the Task and its parameters. The build is run with the command: MSBuild.exe /logger:MyLogger.dll build.xml Within the build.xml is a sequence of tasks, most of which have been custom written to compile a (C++ or C#) solution, a...

MSBuild's XmlMassUpdate task in NAnt?

I have created an MSBuild tasks for building my projects, but for various reasons I wan't to switch to NAnt. Is there some task that would be equivalent to MSBuild's XmlMassUpdate in NAnt? If possible I would like to use the same xml replacement file I used with XmlMassUpdate. (for more info about XmlMassUpdate, here's a short usage I ...

How to use parameters 'Outputs' of task 'Exec' ?

I read it here and tn the description, it says "... cannot gather output from the tool or command that it runs." but in the parameters list there is one named 'Outputs'. I don't understand! What is Outputs for while they say we cannot gather the output? Someone please explain & give an example on using it. Thank you! ...

How to get import custom tasks more than once without warning message?

I'm using some custom tasks from MSBuild Extension Pack (MEP). My projects are splitted among many files. In those files I import the MEP tasks using (twice or three times in two/three files). I receive the warning message when doing this like: ... warning MSB4011: "C:\Program Files\MSBuild\ExtensionPack\MSBuild.ExtensionPack.task...

How to get MSBuild Exec to run a java program?

I am trying to run a command line action in my Team Build (MSBuild). When I run it on the command line of the build machine it works fine. But when run in the build script I get a "exited with code 3". This is command that I am running: C:\Program Files\Wavelink\Avalanche\PackageBuilder>.\jresdk\bin\java -classpath "WLUtil.jar;WLPac...

How to change file encoding when using <Copy> task?

I've search the internet for this but cannot find any related information. Please help! ...

How to add a child node to an xml file given an xpath locating the parent node?

I have an xml file and need to add nodes to it using MSBuild. Please help. ...

install a service on a remote computer from a MSBuild script

I have this task that creates a service: Target Name="InstallService" DependsOnTargets="CopyFiles" Exec Command="sc \ \remotecomputer create "ServiceHost" binPath= "E:\ServiceHost.exe" DisplayName= "ServiceHost"" WorkingDirectory="c:\" ContinueOnError="false" /Target The problem is that when I run this script it doesn't know the \ \re...

How to get the last part of $(MSBuildProjectDirectory)

Can't figure out how to get the last part of $(MSBuildProjectDirectory) For example, if the value was "c:\development\projects\project_branch" then, I want just the last part "project_branch". Any ideas? Thanks, Sean ...

MSBuild Starter Kits...

Hi guys Just wondering if anyone knows if there are any MSBuild starter kits out there. What I mean by starter kits is that from the looks of it most builds to kinda the same sort of steps with minor changes here and there (i.e. most builds would run test, coverage, zip up the results, produce a report, deploy etc). Also what most pe...

Get an error when trying to set the build version with the AssemblyInfo Task

I've added the AssemblyInfo Task reference to my C# project file (VS2008 .NET 3.5), but when I build I get the following error The "AssemblyInfo" task failed unexpectedly. System.ArgumentException: version Parameter name: The specified string is not a valid version number at Microsoft.Build.Extras.Version.ParseVersion(St...

Can XmlMassUpdate be used to delete an attribute?

For example, I have this line: <forms loginUrl="/redirecttosignin.aspx" name="NAME_HERE" requireSSL="false" timeout="60" domain=".blah.com" /> And I want to delete the "name" attribute altogether. I know I can do this to blank it: <forms xmu:key="loginUrl" loginUrl="/redirecttosignin.aspx" name="" /> But, I literally want to get t...