Loren Halvorson's Blog

If your only tool is a hammer...

  • Invoking different NAnt targets on different versions of Windows

    A friend just asked me how to invoke different targets for different versions of Windows using NAnt 0.84. At first I told him to start using NAnt 0.85 so he could use the new string comparison functions, but as I thought about it more, I realized that it's not hard to do without resorting to functions, the following will work fine in either version of NAnt:

  • Versioning Groups of Assemblies in sync

    We often build groups of assemblies that all need to be marked with the same build number. Rather than having the build check out a whole bunch of AssemblyInfo.cs files from source control, set their file versions, and check them in, we use Visual Studio .NET's handy and (not widely known) Linked file feature to centralize the version information into a single file. Then the build only has to worry about updating the build number in one place. Here's how we do it.

  • Deploying .NET config files

    One tricky aspect of deploying a .NET application to a variety of environments (development, test, integration, production) is managing the config files. The more environments and the more config files you have, the bigger your problem.

  • WiX FileGroup element considered evil

    My previous post details a method to use WiX and NAnt to automatically generate MSI's as part of an automated build. I'm going to recommend that no one follow the part of that example that auto-generates the WiX XML. I'm going to blame my spam filter. Let me explain...