Share via


Toolbox

Automated Build Process, Real-World E-Mail Tasks, and More

Scott Mitchell

Contents

Manage the Project Build Process
Sending E-Mail
The Bookshelf

Manage the Project Build Process

While the Visual Studio® Build menu's Build Solution option is the usual way developers compile their current work on a project, the process of building the complete solution for testing, deployment, or production often requires many more steps. The build process varies from company to company, but typically involves checking out the latest version of the source code, running automated tests such as unit tests, performing the actual compilation, and completing any peripheral tasks such as creating Web sites, applications, or virtual directories in IIS, building the database schema and inserting any needed initial or test data, and so on.

The build process is an ideal candidate for automation. Even for small projects, having an automated build process can greatly improve efficiency by reducing the time needed to process the build steps manually and handle any mistakes that may result from performing a build by hand.

There are several open-source and commercial build manager products that can help with automation. NAnt is a popular open-source build manager. With the .NET Framework 2.0, Microsoft has released their own build manager called MSBuild. Both NAnt and MSBuild are designed to be build manager engines, processing build commands from an XML file. Neither engine has an integrated GUI environment through which build scripts can be managed or through which a build's progress can be examined.

A build manager with a very slick, built-in graphical front end is Visual Build Pro by Kinook Software. Visual Build Pro allows the build master to graphically create the build script, selecting a task from the left pane and adding it to the collection of tasks in the right pane. When starting the build process, the interface shows the current step being executed and the status of past steps. Visual Build Pro is not just eye candy. The easy-to-use interface sits atop a powerful and highly customizable build manager engine that can also be accessed through the command line.

Visual Build Pro models common steps in the build process as actions. There are actions to work with Visual SourceSafe®, Current Version System (CVS), Secure File Vault, Subversion, and other popular source control providers. There are also actions to integrate with automated testing frameworks. The actual compilation process of the checked out, tested source code can be performed with actions designed to compile using Visual Studio 6.0, Visual Studio .NET, MSBuild, NAnt, or other tools.

The build process can be a mundane and lengthy task and is best to be automated. Visual Build Pro's interface makes creating and managing builds as easy as dragging and dropping. A wide array of built-in actions make performing common build tasks a snap, and Visual Build Pro's scripting capabilities allow for customized actions. If you're looking for a tool for managing your builds, consider Visual Build Pro.

Price: $295 for a single license.

www.visualbuild.com

Sending E-Mail

For both desktop and Web-based applications, e-mail is commonly used for communication. Domain-specific apps as well as programs in beta testing often include a "Send Feedback" feature that provides the user with a way to directly communicate with the software vendor.

Virtually all Web sites utilize e-mail in some form or another, whether through a Web-based feedback form, a way for one user to contact another while keeping their e-mail addresses private, or an automated way to alert a user that some event has transpired, such as a particular stock price having exceeded a user-defined price per share.

aspNetEmail, by Advanced Intellect LLC, provides the same core functionality as the mail-related classes in the .NET Framework 2.0, but includes a bevy of additional features that greatly ease the process of programmatically sending e-mail. For example, with the .NET Framework classes, you can only set the body of the e-mail message to a string; with aspNetEmail, the body can be a string, the path to a local file, a remote URL, or the HTML output of an ASP.NET server control. aspNetEmail also includes complete vCard and iCalendar support and exposes an event model that allows you to tap into various stages in the mail sending process.

I've used aspNetEmail in two past projects and my favorite feature is its blindingly fast and easy mail-merge function. Rather than send a single message to a list of recipients, mail merges let each message be individu-alized for the recipient. Simply add placeholders in the message body, then call the SendMailMergeList method, passing in a DataSet, DataReader, CSV file, or collection, and the method will automatically enumerate the datasource, fill in the placeholders accordingly, and blast off a personalized message for each record.

Simply sending an e-mail message from a .NET-based application is a walk in the park with the Framework's mail-related classes. To accomplish more interesting, real-world e-mail tasks, however, you'll want to turn to a third-party e-mail component. With its affordable price, ample documentation, and top-notch support, aspNetEmail is a good addition to any developer's toolbox.

Price: $129 for a single server license.

www.aspnetemail.com

The Bookshelf

If you've worked on Microsoft®-based component-oriented systems prior to the .NET Framework, then you're acutely familiar with COM's limitations: component registration that led straight to DLL Hell, the lack of side-by-side execution for different component versions, and the loose coupling between a component and its security semantics, to name a few. While many of these issues were addressed with DCOM, the added complexity limited adoption. Fortunately, many of the ills of COM and DCOM have been righted with .NET. In the .NET Framework, the key principles of component-oriented development—location transparency, concurrency management, versioning, component security, and so on—are baked into the Framework and can be easily utilized by both developers and administrators in ways not possible with previous technologies.

In Programming .NET Components, 2nd Edition (O'Reilly, 2005), Juval Lowy illustrates component-oriented features in .NET. This book is geared to those who are well-versed in component-oriented development, and it includes many sidebars comparing various features in .NET with COM implementations. However, even developers who are not domain experts will find many gems that can prove useful in arenas other than component development.

Lowy begins with a wonderful explanation of the differences between object-oriented development and component-oriented development, along with an examination of the hallmarks of component-oriented development. In the remainder of the book, he spends a chapter on each of the key principles of component-oriented development. Chapter 3 delves into interface-based programming, with some great tips on how to best factor interfaces. Chapter 5 examines versioning, a topic important to any developer who ships a .NET-based library or app. Additional chapters look at events, asynchronous calls, multithreading, and remoting. The book concludes with a lengthy chapter on security.

There are discussions on features specific to the .NET Framework 2.0 and Visual Studio 2005, features that are pertinent to component-oriented development. For example, Lowy examines how generics affect interface design, and explores Visual Studio 2005 capabilities for refactoring. While the book does explore 2.0-specific features, those still using .NET 1.x will find plenty of useful information.

If you are a component developer moving into .NET, work in a component-oriented design shop, or are just interested in learning more about component design in .NET, this is a great place to start.

Price: $44.95.

www.oreilly.com

Computer trade books typically fall into one of two camps: they either focus on a very specific topic or attempt to give a broad overview of a more general topic. The sheer size and weight of Pro ASP.NET 2.0 (Apress, 2005), by Matthew MacDonald and Mario Szpuszta, clearly indicates that it's in the latter camp. Spanning more than 1,200 pages, Pro ASP.NET 2.0 aims to be the one-stop spot for mastering ASP.NET 2.0, covering the wide swath of features and technologies that encompass the dynamic Web development framework. (There are two versions of this book: one with source code in C# and one in Visual Basic®—which was written by Matthew MacDonald and Lawrence Moroney.)

To the authors' credit, Pro ASP.NET 2.0 does a good job of balancing the task of covering a wide array of topics and covering them in depth. The central ASP.NET ideas are explored in detail, with sections on the core concepts, data access, and security each examined over roughly 200 pages. The more peripheral subjects—building custom server controls, advanced Web services, dynamic graphics, and client-side callbacks, among others—are covered in just an overview. This approach strikes the perfect balance between the breadth and the depth of the material.

Pro ASP.NET 2.0 focuses on real-world issues and concerns. Rather than just talking about the power of the provider model, the authors provide working examples of plausible custom providers for membership, profiles, and site navigation. Furthermore, the book covers the trade-offs that accompany various design decisions. For example, in the profiles chapter there's a discussion on when to store data using the default profile provider versus using a custom provider, or simply moving the data to a separate, specific table.

This book is written for intermediate to advanced developers, and assumes that its readers have Web development experience. If you are interested in learning the ins and outs of ASP.NET version 2.0, consider picking up a copy of Pro ASP.NET 2.0.

Price: $59.99.

www.apress.com

Send your questions and comments for Scott to  toolsmm@microsoft.com.

Scott Mitchell, author of numerous books and founder of 4GuysFromRolla.com, is an MVP who has been working with Microsoft Web technologies since 1998. Scott is an independent consultant, trainer, and writer. Reach him at mitchell@4guysfromrolla.com or via his blog at ScottOnWriting.net.