Big msbuild gotcha

Msbuild is not necessarily a "real" component of TFS, but it is heavily integrated throughout its build system (as well as Visual Studio 2005), so I'll be recording my thoughts on it as well. It seems to be better than NAnt, a similar open source product, in most regards, but I have spent the better part of a day getting to the bottom of one of its maddening quirks.

You can define an <ItemGroup> consisting of files that you can copy, zip up, or do whatever you want with, but the collection it will only be evaluated at the initialization of the script!

For example, say you need to deploy all the files compiled by a solution, and then do something else with the binaries. Your build script may look something like this:

<ItemGroup>
	<WebDeploy Exclude="@(ExcludedTypes)" Include="**\**">
	<BinDeploy Include="$(DeployDir)\bin\*.dll">
</ItemGroup>

<Target DependsOn="Compile" Name="Deploy">
	<Copy DestinationFolder="$(DeployDir)\%(RecursiveDir)" SourceFiles="@(WebDeploy)">
	<Copy DestinationFolder="$(BinDeployFolder)" SourceFiles="@(BinDeploy)">
</Target>

The @(BinDeploy) group will evaluate at the start of the script. This means that if you have a "clean" folder setup, the group will be empty, even after the Copy task has been executed. Additionally, if you run the script a second time without deleting the contents of the $(DeployDir), the script will happily copy over the prior build's binaries (even if a Delete task has "deleted" them, and they've been "replaced" by a fresh compile).

To fix this problem, you need to use the CreateItem task:

<ItemGroup>
	<WebDeploy Exclude="@(ExcludedTypes)" Include="**\**">

<Target DependsOn="Compile" Name="Deploy">
	<Copy DestinationFolder="$(DeployDir)\%(RecursiveDir)" SourceFiles="@(WebDeploy)">
	<CreateItem Include="$(PathToCompiledBinaries)\*.dll">
		<Output ItemName="BinDeploy" TaskParameter="Include" />
	</CreateItem>
	<Copy DestinationFolder="$(BinDeployFolder)" SourceFiles="@(BinDeploy)">
</Target>

This will guarantee that @(BinDeploy) isn't created until there are files for it. Do note that this "feature" happens for everything that uses ItemGroups this way; it's not just limited to the Copy task. 

A musical mind

Back when I was a teenager, a CD was a sort of precious commodity. As with most of my peers, I didn't have a ton of money, so shelling out $12-$15 per album was considered an investment; if you ended up with a CD that was barely worth a single listen, you couldn't help but feel like you had been mugged. I think ending up with a crummy CD ranked up there with bombing the SAT's in terms of high school worries.

Since I was essentially hording music like a miser hordes gold, I listened to the same CD's over and over. One side effect of this was that my brain's internal catalogue of music became exceptionally indexed and fast. I remember playing a game with a friend: pick any of my CD's (around 80 or so at the time) and play a random track for 5 seconds, and I'll name the artist/album/song/probably even the lead singer.

Eventually, this ability waned. These days I'll find myself hearing a song that I know I own, but can't remember the band playing it. The CD changed from being an investment to a legacy technology. I haven't purchased a real CD in

over a year; everything has been digital. My collection has grown to over 11,000 songs, and if I find even that number is too little, adding to it is trivial in both time and money. 

I wonder then, do I enjoy this new way of mass consumption more than the old, or should I be taking the time to smell the roses? Sometimes I do wish that I still had my freakishly encyclopedic knowledge of music, but I don't think I'm ready to give up the sheer quantity of it all just yet.

I don't think that is really the copout that it seems to be though. Thanks in part to cheap digital media, I can find quality faster. Before the Internet, I had to wait for magazine reviews to find out if an album was any good (and trust that the reviewer shared similar tastes as me) or depend on word of mouth. Nowadays I can listen to parts or entire tracks without leaving my chair.

So, I guess this is one of those rarer situations where you can have both quantity and quality. Though, I should probably take the time to enjoy more of what I have rather than always being on the watch for my next download.

"Throwaway" dummy text

Why you shouldn't be too outlandish in the garbage text you create when debugging an email script: there may be someone else in the company that has the same name as you, and only a '.' differentiates the address. The "other" Scott Williams was cool about it though. Fortunately I didn't fill the body of the email with random profanities or compromising pictures of myself.

Matt Berther on TFS Source Control

He has a similar background as I do (coming from more of a SubVersion environment) and has similar gripes. I'm planning on writing an entire post on TFS's Source Control, but he covers most of my point.

Link: http://www.mattberther.com/?p=913

TFS versus Open Source

As I've stated before, I haven't had the opportunity to use TFS in my programming lifetime yet. One of the things that has struck me about it is shear cost of all the stuff that is needed. TFS requires a server OS, a SQL Server database, and "prefers" to run on an Active Directory domain. Even on the cheap that easily tops $5,000. There are certain open source products that can provide similar functionality, so for a small business is the extra cost worth it?

Before we answer that question, let's compare the "stacks." For argument's sake, let's assume that the goal is to produce a high quality .NET based application, and that Visual Studio 2005 is the base product used in development1.

For the supplementary server based components, some flavor of Linux would satisfy. MySQL or PostgreSQL could serve as a database supporting BugZilla or Mantis for bug tracking. I have already spoken about SubVersion as an excellent Source Control Management system, but you could certainly also use CVS or whatever else strikes your fancy.

Back in Windows land NUnit or mbUnit can more than adequately run unit tests, and CruiseControl.Net combined with NAnt or msbuild can create a build system. Lastly, there is FxCop and nCover for code analysis and coverage (the former was even originally built by Microsoft!).

For standard development, there isn't a whole let else you need for a project's lifecycle. So, what does the $5-$15,000 price tag give you over open source?

For starters, TFS does wrap all of those things up into one central location - Visual Studio. In the OSS world, you'll have to switch through multiple apps to get the same functionality. This can be annoying, and does take a little while to get everything set up properly2.

Additionally, TFS does make it easier for non-programmers to have more input in the project. In my experience, email has been shoehorned as the "great" management tool; tasks are assigned, documents are passed around, bugs are tracked, and so on. Needless to say, this tends to be catastrophic. TFS, combined with SharePoint does take great lengths to make this work better, for the non-developer.

My feelings right now are mixed - there are certain aspects of TFS that I really like, and some that I do not. I don't think that it is possible to render final judgement on anything until I get a little more experience with it. So stay tuned!

1. Yes, you could even use something like SharpDevelop for even more open source, but if you are so gung ho about OSS, why are you using .NET in the first place? «

2. Of course, the installation for TFS ain't exactly easy itself. «

TFS - Installation

Before I could actually use the fancier parts of Visual Studio Team Foundation Server, I had to first install it. I began by following this Cliffs' Notes version of the process, but changed up halfway through for reasons I'll describe below.

I didn't have a spare machine around that was beefy enough to run TFS, but decided that it would be able to run fine in a Virtual Machine. According to this page, TFS needs IIS, SQL Server 2005, and SharePoint Services all installed as prerequisites. Fortunately I happened to have a partially built VM lying around from when I thought I was going to be using SQL Reporting Services.  I had already installed SQL Server, just not with all of the components to go along with it.

Setting up SharePoint was a little more obnoxious1 than I remembered. Getting the stupid config database set up properly is a royal pain for someone who isn't very familiar with the finer details of IIS and SQL Server. I could probably write a long rant about just that, but I'll save it for another post...

And of course, there are always snags... The default hard drive size for the VM was only 8 GB, too small for TFS to reliably use. The recommended minimum size is 10, so I increased it to 16 for good measure.

Hilariously2, once I finally got all this done and started the actual TFS installer, it informed me that SharePoint was configured incorrectly and needed to be uninstalled, and then reinstalled again. At that point I just went to bed.

Perhaps I should have heeded the warning in the Vertigo blog:

And if there's any question about any of this, don't listen to me! I'm just Some Guy on the Internet(tm)! Refer to the official install guide, man!

The next morning, I decided to go straight to the horse's mouth and consulted the manual for any SharePoint advice. Apparently, I should have done this in the first place, because one of the how-to's listed a simple command-line script to run to get everything set up properly:

stsv2.exe /C:"setupsts.exe /remoteSql=yes /provision=no /qn+"

This took all of 5 seconds to run and install, then politely informed me that SharePoint was good to go.

Once again, I started to install TFS, and finally had success!  Lastly, I installed the Team Explorer client just to take a quick poke around.

That about covers the installation. I'll start doing some basic functionality testing soon and then try to do some of the more advanced stuff.

1. Understatement: I was cursing in languages that hadn't been invented yet. « 2. Not hilarious. «

A topic

I think I have something to write about semi-regularly here. One of the major tasks for my job will be to streamline the build process for a couple of applications that are starting to wrap up their development. I have some experience using open source technology like NAnt and CruiseControl.net, however this project uses Microsoft's Team Foundation Server - which I have not used before.

So, as I bring myself up to speed here, I figured I'd blog about it.

First I'll need to install the whole mess. My current MSDN Subscription does not have the full versions of TFS and the client tools, so I'll be using the 180 day trial version (available for free here if you feel like playing along at home). From what I gathered, installation is rather involved, so I expect this process to take most of the night. As for the client end, I'll start with the plain old Team Explorer plugin, and will probably upgrade to Team Suite's trial as needed.

Wikipedia Nonsense

Apparently, the cat is out of the bag. Certain Wikipedia articles may be edited by people to include their own bias! Amazing, I know. However, this news does not really change my opinion of wikipedia. I still think it is a fantastic resource and incredibly useful when I need to get the basic gist of some random topic that grabs my interest.

Fortunately for me, I have the luxury of not having to do any sort of research that requires concrete evidence. In other words, I am not a student with a paper due. However, the idea that the stuff I read may not be entirely kosher is a little worrisome. There is a relatively simple solution though: references. A good wikipedia article cites the sources of the "facts" it portrays.

What I gain from this is that the article in question is probably pretty sound. And if I still feel that something is fishy, I can actually look those references up(!). Additionally, I can verify that the sources are not just some guy's blog that could be as potentially inaccurate as the wikipedia article.

Ultimately, do not use wikipedia as your sole source of information, but do use it as a springboard to find the real dirt.

eJobHarmony?

Before I turned in my resignation I had been considering seeking new employment for a while. One of the biggest barriers that kept me from diving in sooner was that it is such a pain to find a new job. Aside from having to switch over insurance companies, retirement accounts, etc. there's the whole searching business which can just be annoying.

And then I realized that the process of finding a job is very similar to the dating game. You have "friends" that can hook you up with a "nice" gig ("they have a great personality!"), personals, and meat markets. Heck, you even have pimps (some may call them contractors).

In the dating world, some companies have realized just how hit and miss most of those are and started evaluating personality. I personally have never used a place like eharmony, but I am familiar with the psychology behind their processes.1 And, apparently they have had a pretty decent success rate.

It makes me wonder if the same thing could work in the job market. What if one of the larger job sites like dice.com listed not only the job requirements, but also had a candidate fill out a basic personality profile? Yes, people could just lie on the profile, but they can already do that their resumes too. It would make me feel a little more comfortable going in to a new situation knowing that I was going to fit in with my co-workers.

1. Hey I did actually learn a couple of things in college.«

A change

Well, I'm off on another new job adventure! I just turned in my resignation to my current employer and will be starting my new role in a couple of weeks with Sogeti. I won't go into the sordid details of why I'm leaving, but will say that the primary reason is that I feel I've reached the limit of where my current employer can take me career-wise.

My job will be a kind of blend between the stable world of salary-based pay, and contract-like change of scenery. Sogeti consults for many large clients and sends small teams of developers to either develop solutions or augment existing teams.

So, I'm a little nervous, but also excited. I hope this works out.

About

These are my mostly unfiltered thoughts.