msbuild-task

Programatically find TFS changes since last good build

I have several branches in TFS (dev, test, stage) and when I merge changes into the test branch I want the automated build and deploy script to find all the updated SQL files and deploy them to the test database. I thought I could do this by finding all the changesets associated with the build since the last good build, finding all the ...

"File Not Found" in MSBuild Community Tasks -- Which File?

I'm trying to use the VssGet task of the MSBuild Community Tasks, and the error message "File or project not found" is beating me with a stick. I can't figure out what in particular the error message is referring to. Here's the task: <LocalFilePath Include="C:\Documents and Settings\michaelc\My Documents\Visual Studio 2005\Projects\As...

Unit test MSBuild Custom Task without "Task attempted to log before it was initialized" error

I have written a few MSBuild custom tasks that work well and are use in our CruiseControl.NET build process. I am modifying one, and wish to unit test it by calling the Task's Execute() method. However, if it encounters a line containing Log.LogMessage("some message here"); it throws an InvalidOperationException: Task attempted t...

MSBuild copy output from another project into the output of the current project

I have a situation where I want to copy the output assembly from one project into the output directory of my target application using MSBuild, without hard-coding paths in my MSBuild Copy task. Here's the scenario: Project A - Web Application Project Project B - Dal Interface Project Project C - Dal Implementation Project There is a ...

MSBuild ReadLinesFromFile all text on one line.

When I do a ReadLinesFromFile on a file in MSBUILD and go to output that file again, I get all the text on one line. All the Carriage returns and LineFeeds are stripped out. <Project DefaultTargets = "Deploy" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" > <Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MS...

How to get Build output, error list, when running Project.Build() in a custom build task?

Environment: C# projects, Visual studio 2008, C#, .Net 3.5, MSBuild Objective: Run my own custom build task for my C# projects, and based on the platform (Soln configuration platform), I do some manipulations to the Project object itself before build. Like setting BuildAction to EmbeddedResource etc. Once that's done I call Project.B...

MSBuild ITaskItem array is out of date

I'm creating a custom ITask for MSBuild which uploads the output files of my build. I'm using a web deployment project to publish my app and hooking in to the AfterBuild target to do my custom work. If I add a file to my web application, the first time I do a build, my custom task is not recognizing the recently added file. In order fo...

Defining multiple values in DefineConstants in MsBuild element?

I'm currently integrating my Wix projects in MSBuild. It is necessary for me to pass multiple values to the Wix project. One value will work (ProductVersion in the sample below). <Target Name="BuildWixSetups"> <MSBuild Condition="'%(WixSetups.Identity)'!=''" Projects="%(WixSetups.Identity)" Targets="Rebuild" Properties...

Targetting different Frameworks using MSBuild gives problems with dependencies.

I have a little project, and I want to have 2 compiled versions of that project: one that is targetting the .NET 2.0 framework one that is targetting the .NET 3.5 framework All is going well; I've put my project under continuous integration (using CC.NET), and I've created 2 CC.NET 'projects'. One project for each target-framework. ...

How do you recursively call tasks in MSBuild ?

E.g. I want to call these scripts passing diff params each time: <ItemGroup> <SqlFiles Include="$(SourceServicesDbSqlRootDir)CreateScripts\$(SourceServiceName)\Tables\*.sql" /> <SqlFiles Include="$(SourceServicesDbSqlRootDir)CreateScripts\$(SourceServiceName)\Functions\*.sql" /> <SqlFiles Include="$(SourceSe...

Is It Possible to Update a WCF Service Reference in a Web Deployment Project

I think the question title neatly sums up what I am after. I have a web app and a service and I would like the build script to check if the service has been updated since the last build and if so, run the "update service reference" script that is available when you right-click on a service. Any ideas? ...

Retrieving multiple item metadata with the same name in c# msbuild task

Hi, How can I get multiple item metadata with the same name in a c# msbuild task, for example if I were to have: <ItemGroup> <Assemblies Include = "S:\SVN\SomeDirectory\src\"> <excludeAssembly>AssemblyName_1</excludeAssembly> <excludeAssembly>AssemblyName_2</excludeAssembly> <excludeAssembly>AssemblyName_3</excludeAssembl...

MSBuild Task Configuration Property

Three VS Solutions. First is configured to build as Release, and the other two set to build as Debug. When running a simple MSBuild script explicitly stating the configuration to build (Debug) the first project is still built as Release. Sample script: <Target Name="Build"> <ItemGroup> <ProjectToBuild Include="$(Solution...

Convert HTML (WSDL/XSD doc) to MHT in a MSBuild step

Folks, I have some HTML generated from my WSDL and XSD files for a web service, and I'd like to convert thos two HTML, along with some images (company logo) and CSS file(s), into a single MHT file during my continuous integration, so that I can distribute it to customers (other devs outside the company using this web service). I'd li...

Is a separate Visual Studio license required for a build machine?

I know that some companies allow you to install their products on build machines as required without requiring a separate license (DevExpress is one that comes to mind). However I was wondering if Microsoft had the same allowances on licenses. MSBuild does not support vdproj directly and require you to run Visual Studio from the command...

Visual Studio integrated custom MSBuild task behaviour

I was looking around the net for a NUnit custom MSBuild task that would run on every build and also nicely play with Visual Studio UI (2008 is my version). I found MSBuild.Community.Tasks project that was great, but failed in Visual Studio integration part. What I actually wanted to have is get failed tests displayed as warnings/errors i...

MSBuild MSBuildCommunityTasks Task Time

I have a MSBuild project and I want the current date to be added to a zip file that I am creating. I am using the MSBuildCommunityTasks. '' '<'Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"'/>' On the website http://msbuildtasks.tigris.org/ I can see a task called time. I hav...

Honoring exit codes from batch files invoked by msbuild

I have a batch file that is using the exit command to return an exit code. This batch file may, in some cases, be invoked interactively from a commandline, or in other cases, may be run as part of an MSBuild project, using the Exec task. If I use exit %errorlevel% within my batch file this works well and MSBuild sees the error code, h...

How to compel MSBuild to not build a target partially?

I have a build process that does the following: Runs TLBIMP on a number (say 10) of COM DLLs (a named group of TaskItems). This is my "Import" target that uses the Exec task. Runs ILDASM on the 10 interop assemblies. This is my "Disassemble" target that uses the Exec task. Runs a custom task to take all of the 10 IL files at the same t...

Msbuild copy to several locations based on list of destination parameter?

I got a directory I want to copy to a number of locations. Say I have home.aspx I want to copy it to abc/home.aspx def/home.aspx ghi/home.aspx so two questions for me: How do I define the list abc, def, ghi? How do I execute my Copy task with each element of this list? ...