Reduce Development Headaches With Draco.NET

Once you try this free continuous integration tool, you’ll wonder how you ever lived without it.

Ken McNamee

October 30, 2009

5 Min Read
ITPro Today logo in a gray background | ITPro Today

asp:ToolKit

LANGUAGES: All .NET Languages

TECHNOLOGIES: .NET Compilers | NUnit | NAnt

 

Reduce Development Headaches With Draco.NET

Once you try this free continuous integration tool,you'll wonder how you ever lived without it.

 

By Ken McNamee

 

If Stephen King were a Web developer, he might write aboutthis nightmarish - but common - scenario: You're leading a development teamworking on an important Web project. The budget is tight, and the deadline islooming. Everybody is working feverishly, making changes and checking code inand out of Visual SourceSafe (VSS). At the end of every day you do a "GetLatest" from VSS, fire up Visual Studio .NET, build the project and ... BAM!The Task List fills up with so many compile errors in multiple files that you haveno clue where to begin. You must sift through every error manually, hopingthere was one root problem that triggered an exception cascade.

 

Your worst fears are confirmed as you realize fixing thebuild is not going to be easy; there are several distinct overlapping issuesthat multiple developers worked on throughout the day. So you huddle everyonetogether and try to hash out what went wrong. Then, as a last resort, youperform a code rollback and reintegrate the changes one by one as you work wellinto the night.

 

Visual Studio .NET is a great ASP.NET development tool,but I find it still lacks some facility in reducing a development team'sheadaches. Luckily, groups of programmers are out there creating free,open-source tools - using the .NET Framework - that pick up where Visual Studio.NET leaves off. I've written previously about NUnit and NAnt, which are usedfor unit testing and building and deploying, respectively. Draco.NET is alogical conclusion to this open-source trilogy because it actually works withNUnit and NAnt continuously to ensure the integrity of the code stored in yourVisual SourceSafe database.

 

Take Two

So let me rewrite that nightmare scenario using Draco.NET:Your development team members are working feverishly - making changes, checkingcode in and out of Visual SourceSafe, and adding comments as they check thefiles in so it will be easy to see what changes they made. Draco.NET polls theVisual SourceSafe database periodically to see if any files were changed sincethe last time it checked. If a change was made, Draco.NET does a "Get Latest"to a temporary directory, invokes NAnt to build the project, runs the NUnitunit tests, and deploys the code to a test server. At the end of this processDraco.NET sends an e-mail to the team members notifying them of the changesthat were made, using the comments in VSS, and letting them know whether thebuild was successful. If any steps in the process fail, Draco.NET includes thecompiler output showing which files failed the build and the code line thatcaused the problem. Instantly, everybody can see there was a problem, what theproblem was, and who needs to correct it. Pretty amazing, if you ask me.

 

Recently I worked on a development team that usedDraco.NET extensively and I can honestly say it can provide some significantbenefits in both developer productivity and sanity. So how does it work? It'sactually quite simple. Draco.NET runs as a Windows Service that uses a .NET XMLconfiguration file to determine which Visual SourceSafe databases to poll andhow often to poll them. It also includes options for e-mailing the results.Figure 1 is an example of a simple Draco.NET configuration file.

 

             type="Chive.Draco.Config.ConfigurationSection,Draco"/>           60     mail.yourcompany.com     [email protected]                            MyWebApp         10                                 [email protected]                                   C:WorkingBuildOutput                                              MyWebApp.build             StartTest                                                     value="value1" />                                        value="value2" />                                                $/MyWebApp              mark             foobar             C:VSSMyWebAppDb                                                 MyWebApp                                       [email protected]                                                MyWebApp.sln             Release                                   $/MyWebApp             mark             foobar             C:VSSMyWebAppDb                                    Figure 1. Like ASP.NET, Draco.NET uses an XMLconfiguration file to control which Visual SourceSafe databases to poll forchanges, how often to poll them, and where to e-mail the results.   The key elements in the configuration file are the elements, which allow Draco.NET to poll multiple VisualSourceSafe databases using different settings including the .The shown in Figure 1 is assigned a global position outsidethe node, but you also can set it inside each element. Notice that the first element has a nodethat specifies which NAnt build file to use and also sets targets andproperties. The second element has, however, a node that allows Draco.NET to use Visual Studio .NET to build the Webapplication using the solution file. This is convenient if all you need to dois get and build the latest code from Visual SourceSafe without running unittests and deploying the project. This saves you from installing and configuringNAnt if you don't need NAnt's additional features.   Believe me when I say Draco.NET can save you a lot offrustration and wasted time. It does what a computer does best: It accomplishesa tedious, repetitive task faster and more efficiently than a person can. Iwould say Draco.NET is worth every penny ... but it's free, so that doesn'tquite fit. But because time is money, I can say with confidence that it'sdefinitely worth your time to download and use it on a trial basis. Draco.NETis easy to download, install, and configure. And once you grow to depend on it,it will be hard to live without.   ReferencesDraco.NET Home Page: http://draconet.sourceforge.netNAnt Home Page: http://nant.sourceforge.netNUnit Home Page: http://nunit.sourceforge.netContinuous Integration: http://www.martinfowler.com/articles/continuousintegration.html   Ken McNamee is an independent consultant who works withcompanies in need of highly scalable, data-driven Web applications. And whodoesn't need one of those these days? Prior to this, he led a team ofdevelopers in re-architecting the Home Shopping Network's e-commerce site,HSN.com, to 100 percent ASP.NET with C#. E-mail him at [email protected].   Tell us what you think! Please sendany comments about this article to [email protected] include the article title and author.      

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like