MSBuild Custom Task and TFS

I tried to kick off the a custom build task using TFS like so:

image

The .csproj has 1 file:

image

And the 1 class has the following code:

using System; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; namespace Com.Tff.Carpool.Build { public class PublishWebSite : Task { public override bool Execute() { return true; } } }

However, the build just hangs:

image

I then realized I never included the Build in the .csproj definition. I unloaded the project and added the following line of code:

image

I then reloaded the project and it still just hanged. I then realized that my Build Controller was not running <sound of me slapping my head />

image

Once I started the build controller, the job kicked off and ran:

image

I then added the workflow from this previous post to the Build and it ran.   I then went to the build definition’s Process tab and realized I was using the Default template:

image 

It seems to me that the path of least resistance would be to have a couple of WF tasks in the Template that takes the website and FTP it out. I would do this versus creating a new project that has the workflow and then has to find the files in the drop folder.  Therefore, no MSBUild tasks.

I first created a new template based on the default:

image

Note that I have to manually add the template to source control:

image

I then double clicked on it to alter the definition- and waited 15 seconds for the screen to refresh – holy cow this workflow is a beast!

image

I want to add 1 task at the end – ftp contents to a remote directory. I wonder how I am going to unit test this. I realized that I need to create the FTP Workflow in a different project, test it, and then move it over into this template.  That will be the subject of my next post.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: