Sheesh, I sure have been busy ... poor blog is getting neglected. Oh well, I figured the least I could do was post links to my latest articles on CMX
Compiling with NAnt and Auto Zip Downloads with ASP.NET
NAnt is an open source build tool that allows you to (amongst other things) compile .NET code using an XML script. From the XML build script, you specify tasks that run the gamut from the actual compilation of your code, to xcopy deployment, zip compression, even automatically running unit tests (using a tool such as NUnit).
Why Use NAnt Instead of something like Visual Studio?
Certainly, there are other options for compiling .NET code. Whether you have the budget for Visual Studio.NET, or use the open source #Develop, things are not always as simple as using the IDE to compile and deploy your projects. Often times, depending on the size of your team and scope of your project, it is beneficial to build the code on a clean machine where unknown depencies can lull you into a false sense of safety.
The benefits of such automation are rarely seen at the beginning of a project ... but as the timeline moves on, deadlines approach, feature creep sets in. All of a sudden, it's chaos as multiple developers are working on different parts of the program. One developer checks in his changes for the day, only to find that his changes have caused compilation errors in the project for other team members. Sadly, I've been subject to this very scenario more times than I'd like to remember.
NAnt could have solved the issues described above by allowing the team to set up automated daily builds. That is, a build script could have been written that would grab the latest version of the code from the source control server, attempt a build, and email the results to the team lead. Scheduling the task is easy enough through Windows scheduler, and the daily build could have been done before everyone goes home for the night to identify unknown issues.
Auto Zip Downloads with ASP.NET
I once had a site that I helped to administer that, amongst other things, hosted a great deal of forms in .pdf format for their partners to download. In addition to the files being available separately, they were grouped together in zip files to ease several different tasks (these were insurance agents). Unfortunately (for me), these files were updated quite often so I had to spend a lot of time updating and uploading the individual pdf document and each and every zip file that included it.
As you can probably guess, this was kind of error prone as I would forget to update a zip file from time to time. Eventually, I decided I had enough so I decided to automate the process.
This article shows you how to create a self-maintaining file packaging service for your site. Code is provided in C#