Code

this.Log– Source, NuGet Package & Performance

Recently I mentioned this.Log. Given the amount of folks that were interested in this.Log, I decided to pull this source out and make a NuGet package (well, several packages). Source The source is now located at https://github.com/ferventc... Please feel free to send pull requests (with tests of course). When you clone it, if you open visual studio prior to running build.bat, you will notice build errors. Don’t send me a pull request fixing this, I want it to work the way it does now. ......

From Zero To Deployed Contest–Winner Announced PLUS Extension To Most Creative

Recently we had a contest to see who could beat my time to get from no code to deployed. Thanks to everyone that participated and everyone that thought about participating in the contest. Most Creative From Zero To Deployed Contest Extended! Unfortunately there were not enough entries to award the most creative video for ZtD. So what we are doing is extending the most creative until May 15, 2011 @ 11:59 PM CST. This gives you almost two months to get your videos in! If you entered before, you are ......

UppercuT - Automated Builds - CruiseControl.NET Integration

So now you are rolling with UppercuT, but you don’t yet have Continuous Integration (CI). You can make that happen with CruiseControl.NET (or any other CI server like TeamCity or Hudson). This article is geared to CruiseControl.NET (CC.NET), although there will be future articles on other CI servers. This is specifically geared towards CC.NET 1.4 and above, because it takes advantage of preprocessors. First a few sideline notifications and then we'll get right into it. UppercuT Compatibility with ......

UppercuT - Automated Builds - User Group

If you have questions, you want to know about new features, or you want to get more involved, feel free to join the group.

http://groups.google.com/group/chucknorrisframework

Uppercut - Automated Builds - DeploymentBuilder

UppercuT comes with DeploymentBuilder. What is DeploymentBuilder? Perhaps you maintain a bunch of deployment scripts that point to all your different environments. We now you can define a template batch file and let UppercuT create all of those deployments scripts for you. It's less for you to maintain, and you no longer have to update a bunch of different scripts. Just one or a couple depending on the types of deployment. To help people better understand what it can do, we've included a starting ......

Super D to the B to the A – AKA Script for reducing the size of a database

The following is a script that I used to help me clean up a database and reduce the size of it from 95MB down to 3MB so we could use it for a development backup. I will note that we also removed some of the data out. I shared this with a friend recently and he used this to go from 70GB to 7GB! UPDATE: Special Note Please don’t run this against something that is live or performance critical. You want to do this where you are the only person connected to the database, like a restored backup of the ......

Refresh Database–Speed up Your Development Cycles

Refresh database is an workflow that allows you to develop with a migrations framework, but deploy with SQL files. It’s more than that, it allows you to rapidly make changes to your environment and sync up with other teammates. When I am talking about environment, I mean your local development environment: your code base and the local database back end you are hitting. Refresh database comes in two flavors, one for NHibernate and one for Entity Framework. I’m going to show you an example of the one ......

Symbolic Regular Expression Exploration

This is a pretty sweet little tool. Rex (Regular Expression Exploration) is a tool that allows you to give it a regular expression and it returns matching strings. The example below creates10 strings that start and end with a number and have at least 2 characters: > rex.exe "^\d.*\d$" /k:10 This is something I could use to validate/generate the Regular Expressions I have created with both UppercuT and RoundhousE. Check out the video below: Margus Veanes - Rex - Symbolic Regular Expression Exploration ......

Virtual Alt.NET – UppercuT Automated Builds

Tomorrow on February 24th, 2010, I’m going to be giving a presentation on UppercuT (UC) at Virtual Alt.NET (VAN). If you are interested in learning about an automated build tool that will save you time and get you to a professional build in moments, not days, you can log into the VAN around 8PM CST on Wednesday (tomorrow). You don’t even have to go to a physical place to see the presentation! You can hang out from the comfort of your own home and watch me walk through how easy it is to use UC. Here ......

HowTo: Use .NET Code on a Network Share From Windows

If you use VMWare/VirtualPC and you want to offload your source code repositories to your host OS and code from it inside the VM, you need to do a few things to fully trust the share. I’ve found that I keep heading out and searching on this every time I need it so I thought I would write it down this time to save myself the trouble next time. CasPol Changes Save the following as caspol.bat: %WINDIR%\Microsoft.NET\Fram... -q -machine -ag 1.2 -url file://e:/* FullTrust %WINDIR%\Microsoft.NET\Fram... ......

DropkicK–Deploy Fluently

DropkicK (DK) has been in development for over two years and has been used for production deployments for over a year. Dru Sellers originally posted about DK back in 2009. While DK isn’t yet as super easy to grok as some of the other ChuckNorrisFramework tools and offers little in the idea of conventions, it is still a stellar framework to use for deployments. DK works well in environments where you know all of the environments you will deploy to ahead of time (although not required due to the ability ......

SidePOP XMLConfigurator

From my previous post on SidePOP, I wanted to make it even easier to configure SidePOP. So instead of the configure_mail_watcher() from the last post, this is what it looks like now: private void configure_mail_watcher() { EmailWatcherConfigurator configurator = new SidePopXmlConfigurator(); foreach (EmailWatcher emailWatcher in configurator.configure()) { emailWatcher.MessagesReceived += runner_messages_received; emailWatcher.start(); } } Pretty. Notice that Runner became EmailWatcher and instead ......

How To Check Email Programmatically - SidePOP

Background Sending email has long been easy to do with the .NET Framework. There really hasn’t been a facility for checking email though. I recently had a need to be able to check email with and send a response with Bombali (a monitoring tool). I went searching for examples or a solution I could use. I found a few articles on this from a few years ago including the .NET POP3 MIME Client. I never found anything that was free and I never found anything that was easy to configure. Those who know me ......

Command Line Parsing on Windows with Mono.Options

When you have command line arguments to parse (whether on Windows or Linux), the place to look is Mono.Options. To date, I have not found anything better to get the job done. It is a single C# file if you do not want to download the entire Mono Library to use it. I was first introduced in Mono 2.2. The equivalent product is NDesk.Options by Jonathan Pryor. His single Options.cs file has been implemented as Mono.Options. To demonstrate how easy command line parsing can be, I’m going to show you is ......

RoundhousE: Version Your Database

Versioning your database is as important as versioning your code. How much time do we waste currently before we are even productive when we have to fix or enhance something in a database? RoundhousE versions your database how you want. The recommended way is to version based on source control, but that may not be your solution. But for a moment let’s pretend it is. Why would versioning your database based on source control be a big help? What happens if you get a prod fix (or work order) to fix a ......

NHibernate Event Listener Registration With Fluent NHibernate

I’m a huge fan of NHibernate. It has excellent documentation and just makes the whole job of getting things into and out of the database much more enjoyable. There is a whole series of posts on NHibernate from one of the committers, Ayende. When Fluent NHibernate (FNH) came out, it was like butter on sliced bread. FNH makes it even easier to use NHibernate. Ayende had a post a while back on how to use Event Listeners. That helped me to get to event listeners set up. Event Listeners namespace somethingimportant.we.hope.... ......

RoundhousE: Configuration

This week I introduced RoundhousE and it’s getting quite a stir. Let’s take a look at the configuration. We are going to focus on the MSBuild/NAnt task configuration for now because the console isn’t yet complete. The console will actually have at least this much if not more (we’ve talked about how to use it to create the migration scripts and not just run them). Because we like to be able to infer things, we have determined that there are only two required items. Thus – the minimal configuration: ......

RoundhousE DB Migration: Action Shots

I just started the appetites with my last post on RoundhousE. RoundhousE itself has a migration sample to help you get familiar with how it works. You can get to that by using a subversion client to download the source. When you download the RoundhousE source from SVN and run build.bat, you get a code_drop folder. Go in there and look at the deployment folder for a sample run. Prerequisites: Locally installed (and running) SQL Server 2008 Run That Bad Boy When you get into the code_drop folder, take ......

Published Applications AKA _PublishedApplications

Less maintenance. Less work to package during your automated builds. Too easy. Remember Our Old Friend _PublishedWebsites? You’ve probably seen the _PublishedWebsites folder when building websites in automated builds. If not you can stop paying attention now. Still with me? Great! So you know how it packages up everything nicely with content files going where they should with nearly ZERO cost to your build scripts. All you need to do is override the output directory (OutDir) and you get this feature. ......

MSBuild.Community.Tasks - WebDirectoryCreate / WebDirectorySettings Patch Accepted

It appears that my patch finally got accepted and rolled into MSBuild Community Tasks. I posted it back in December and just saw the commit email in the last two weeks. It is the first patch I have submitted to Open Source that has been accepted (also the only patch submitted so far). I plan on submitting patches to this and possibly to Nant as I start working heavily in tasks in the near future. One of which will be ServiceCreate based on one I found from a guy, except adding the ability to set ......

AppHarbor - Azure Done Right AKA Heroku for .NET

Easy and Instant deployments and instant scale for .NET? Awhile back a few of us were looking at Ruby Gems as the answer to package management for .NET. The gems platform supported the concept of DLLs as packages although some changes would have needed to happen to have long term use for the entire community. From that we formed a partnership with some folks at Microsoft to make v2 into something that would meet wider adoption across the community, which people now call NuGet. So now we have the ......

UppercuT v1.2–NuGet Support

For those that have not yet heard, NuGet went v1 recently along with a whole slew of tools from the Microsoft folks. I’ve been lucky to be a part of the NuGet project and see it take shape over the past few months with community input and contributions. Even though v1.0 was released, we are already moving forward with getting ideas and prioritizing features for the next version. To follow the announcement, UppercuT (UC) v1.2 now includes support for NuGet out of the box. Plus, it will handle versioning ......

The Evolution of Package Management for .NET

The thing to realize is that the destination is never the most important part of the journey. It’s the journey itself. When you start a journey, you are never fully sure where it is going to end up. We started the journey down package management for .NET three times with Nu[bular] (we in this context means the nu team, not me in particular, I was only involved in the last reboot) before we decided to try an existing infrastructure with Ruby Gems. I have always said that I would use the best tool ......

Herding Code Talks About Nu

Dru and I were recently featured on Herding Code Podcast. In the podcast we talk about everything from package management in general to Nubular (Nu) to other package management systems (OpenWrap, Bricks, and Horn, although horn was/is slightly different) to the possibility of Microsoft releasing a package management system. It was a good time and I enjoyed doing the podcast, but the herding code guys start recording at an insane 10:30 PM! I have no idea how I made it through the whole thing and was ......

Gems For .NET – Community Response

There has been a lot of response in the community about this gems idea we’ve been talking about. I even had the opportunity to sit down with Nick Quaranto, the guy behind Rubygems.org, over coffee Sunday and talk about where we think we are going and what it will take to get there. One of the biggest things that everyone wants to see carrying this idea forward is that we migrate off of Rubygems.org and have our own gem server. And we all agree this is a great idea. There are just two things that ......

How To – Gems And .NET – Dependencies (References)

In my last post I didn’t mention dependencies. Dependencies are their own animal. They require a couple more things to be in place. Let’s talk about those things. In the .NET world, the dependency for compiled bits is usually an exact version of a reference. Let me explain. So for example, you have a reference to log4net, and you don’t ILMerge it into your assembly. You now have a dependency that the DLL needs to be there and a particular version (outside of redirecting the bindings). So what I’m ......

How To - Gems And .NET

In my last post I showed gems being used for .NET. Now let’s talk about How. Most of this stuff I’ve learned over the past two days, so if I have a mistake here or you have a better idea, please don’t hesitate to offer a better solution. The GemSpec The Gem::Specification reference is your friend. In order to create a gem, you need to define a gem specification, commonly called a “gemspec”. A gemspec consists of several attributes. Some of these are required; most of them are optional. From here ......

The Future of .NET Open Source Software Delivery

Imagine we are awhile into the future. How do you get open source releases down to your project so that you can use them? How do you get the products down to your computer so that you can use them? Is it easier or harder than the way we’ve always done it before? The Past and Present Before we can go there, let’s look at what we do now (the past is really the same for us here). Let’s say I want to use NHibernate. What do I do? There are basically three paths we all follow in this process. 1. Never ......

How To – UppercuT and Gems

In a previous post I mentioned how I was going to show you how UppercuT (UC) has the ability to make gems stupid simple to create and publish. You ask if gems can get any easier and to that I answer, “Why YES, they can!” How about just filling out the information for the gemspec, running a build and having a nice, shiny new gem ready for publishing? Rock The Gems Basically you want to get the latest release of UppercuT. You can download it or grab the source and compile. There are already instructions ......

UppercuT - TeamCity Integration - Part 4 (Code Drop / Artifacts of the Build)

In Part 1 we create a project. In Part 2 we set up the Build Configuration. In Part 3 we ran the build. Now we are just going to note how we get to our code. Code Drop / Artifacts TeamCity stores all artifacts in a database. So for every build, the drop location is not a physical disk location, it’s actually in a database. This is why we called zip.bat instead of build.bat. We have to download the items from TeamCity and want to just download the one file. If we download that file and unzip it, we ......

UppercuT - TeamCity Integration - Part 3 (Run the Build)

In Part 1 we create a project. In Part 2 we set up the Build Configuration. This time we will Run the build. Run the Build Project 1. Click on Projects. 2. You can see that the new project has not run before due to the question mark. 3. Let’s kick it off. Click {Run |…}. 4. The page refreshes automatically to show that we are running. 5. NOTE: The first build may fail due to folder cleaning that is happening at the same time. You will see a note in the build log that it is deleting items at the same ......

UppercuT - TeamCity Integration - Part 2 (Create a Build Configuration)

Last time we created a project. This time we will set up the build configuration with it. Create a Build Configuration 1. Click {add a build configuration} for this project. 2. In the [Name:] field, we need to add something descriptive. We are building the trunk on every change. Let’s call it Bombali Trunk CI. 3. In [Artifact paths:] enter code_drop/*.zip. 4. In the Fail build if: section, ensure that these settings are checked: a. build process exit code is not zero b. at least one test failed c. ......

UppercuT - TeamCity Integration - Part 1 (Create a TeamCity Project)

Integrating UppercuT with TeamCity is actually very easy. We will go through the steps to set up and run a build. Let's start with Creating a project. Create A Project 1. Log into TeamCity. 2. Go to Administration. 3. Click on create project. 4. Type a name for your project. Try to use an identifying name. In our example, we are using Bombali. We also add a nice description about the project. Choose what is most appropriate for you. 5. Click {Create}. Next we will create a Build Configuration. UppercuT ......

UppercuT - Automated Builds - Test Category Filters

I'm happy to announce that UppercuT now has test category filters. The NUnit Task had them by default. To get categories added to MbUnit Task, I had to go back to the source code and add them. I followed the same format that NAnt-Extensions used: <mbunit report-types="Html;Xml;Text" report-filename-format="${f... report-output-directory="${... halt-on-failure="true" failonerror="true" > <assemblies> <exclude name="${dirs.build}\*Databa... /> <exclude ......

UppercuT - Automated Builds - Getting Started Part 0 (Prerequisites)

In all discussion about how to get started, I didn't mention that there are prerequisites to using UppercuT. Well, really there is only one prerequisite. Prerequisites Source control command line tool on the path If you are unsure, open a command line and type svn to find out if you already have it installed. Download In our case Subversion Command line client. You can get that from Collabnet (you will have to register) at http://www.collab.net/downl... Note: If you have installed VisualSVN, ......

NDepend and CruiseControl.NET

NDepend is one of the best code analysis tools out there for determining code quality! It does so with some advanced metrics and I can say I still don't understand all of it, but we take advantage of the areas we do understand! It will help point you to possible problems with code during code reviews and it has some nice images to help visualize what's going on in your code. You can even hook it up to CruiseControl.NET (CC.NET) and see reports for NDepend per build. We are going to talk about how ......

UppercuT - Automated Builds - Getting Started Part 3 (Configure UppercuT.config)

In Part 1 we downloaded or built from source control. In Part 2 we added UppercuT to our project. Now we need to edit the UppercuT configuration. Let’s UppercuT our code! UppercuT.config 1. Navigate to the Settings folder and open the UppercuT.config file in your favorite editor. 2. Take a moment to familiarize yourself with all of the options available in the configuration file. 3. Copy the name of the solution file (minus .sln). 4. Select the current value of the project.name property. Currently ......

UppercuT - Automated Builds - Getting Started Part 2 (Add UppercuT to Your Project)

In Part 1 we downloaded or built from source control. We are now ready to add UppercuT to our project. Let’s UppercuT our code! Add UppercuT to Your Project 1. We open the folder at the top level of the project (usually just under trunk or a branch). Below you can see we have a project called MoneyQIFGenerator and it has no automated build love yet. 2. We already have a references folder (lib) so we are going to do something differently when bringing in UppercuT. For any existing project this could ......

UppercuT - Automated Builds - TeamCity Integration Coming

This is a quick update to note that TeamCity is on it's way to being supported. I was given a patch for this and I am about verify that it works (it came from a trusted source through, so I am pretty sure it will). You know what the greatest part of the patch was? It was one line of code. <property name="version.build" value="${environment::get-v... if="${environment::variable... /> We don't even need a setting to determine if the build server is ......

UppercuT - Automated Builds - Getting Started Part 8 (Next Steps)

In Part 1 we downloaded or built from source control. In Part 2 we added UppercuT to our project. In Part 3 we set up the UppercuT configuration. In Part 4 we updated our reference folders if we needed to. In Part 5 we built our code successfully. In Part 6, we checked into source control. In Part 7, we automatically ignored folders for SVN. What are the next steps to take advantage of the power of UppercuT? The Power of UppercuT UppercuT comes with many great features! You now have automated build ......

Nothin But .NET Coming to KC End of August

I attended JP's Nothin But .NET last November in Philadelphia and it was the best course I have ever been to! Sooner than you know it will be in Kansas City this year. It starts Monday, August 31, 2009 at 8:00 AM and goes through Friday, September 04, 2009 at 10:00 PM. I can tell you from experience it will probably be over more like at 4AM on Saturday morning! If the price looks like a lot, keep in mind that this price is REALLY CHEAP for the amount of training and learning that you receive. This ......

UppercuT - Automated Builds - Getting Started Part 7 (TortoiseSVN Global Ignore List)

In Part 1 we downloaded or built from source control. In Part 2 we added UppercuT to our project. In Part 3 we set up the UppercuT configuration. In Part 4 we updated our reference folders if we needed to. In Part 5 we built our code successfully. In Part 6, we checked into source control. This is a recommendation on automatically ignoring folders for SVN. TortoiseSVN Global Ignore List Because TortoiseSVN is the most commonly used client, it’s worth mentioning the Global Ignore list. You benefit ......

UppercuT - Automated Builds - Getting Started Part 6 (Source Control & What NOT to Check In)

In Part 1 we downloaded or built from source control. In Part 2 we added UppercuT to our project. In Part 3 we set up the UppercuT configuration. In Part 4 we updated our reference folders if we needed to. In Part 5 we built our code successfully. Now we are ready get this into source control. Let's UppercuT our code! Artifacts of the Build UppercuT outputs some files and folders that should never be checked into source control. These are basically the same as what is in your bin directories with ......

UppercuT - Automated Builds - ConfigBuilder

UppercuT comes with ConfigBuilder. What is ConfigBuilder? ConfigBuilder will build a configuration file per environment so you no longer have to maintain a bunch of configuration files. In any project you have app.config (or web.config) files. You just create a .template file next to it. The web.config has a file next to it named web.config.template. What do you name the app.config template files? You have to name the file based on what app.config becomes when visual studio builds the application. ......

UppercuT - Automated Builds - UppercuT.config

Recently I posted about UppercuT, the insanely easy to use build framework. There are so many things you can do with UppercuT, that it may make your life easier. We decided to make it even easier to use UppercuT by using a convention most people in the .NET world understand, the .config file. This replaces the build.settings.bat file for those of you who were using it. All you need to do now is navigate to the Settings folder and open the UppercuT.config file in your favorite editor. Get Building ......

UppercuT - Automated Builds - Getting Started Part 5 (Build IT!)

In Part 1 we downloaded or built from source control. In Part 2 we added UppercuT to our project. In Part 3 we set up the UppercuT configuration. In Part 4 we updated our reference folders if we needed to. Now we are ready to build. Let's UppercuT our code! BUILD IT! What You’ve Been Waiting For 1. Open a command line in the current folder. There is an excellent tool called StExBar that will allow you to do this by pressing {Control} + {M}. 2. Type build. Press {Enter}. 3. Now watch UppercuT in action. ......

UppercuT - Automated Builds - Getting Started Part 4 (External Libraries / Tools)

In Part 1 we downloaded or built from source control. In Part 2 we added UppercuT to our project. In Part 3 we set up the UppercuT configuration. This is a small update into where you keep your external references. If you keep them where UppercuT defaults to, you can skip this step. External Libraries/Tools It’s important to note that not everyone keeps their references to external libraries (lib) in the same location in source control. That’s fine, but it requires a little additional work. In the ......

Gems - Package Management For .NET

The Ruby community has enjoyed a great user experience with a package management system they use called Gems. A gem is a package (or a library), compressed with some additional metadata, and can be either source files or binaries. Let’s focus on binary gems. We have the same concept in .NET (DLLs/EXEs). You may have references to other DLLs. When you want to update a reference you are using on a project, you may also need to update its dependencies as well. And so on and so forth. A package management ......

UppercuT - The Insanely Easy to Use Automated Build Framework

UppercuT is the insanely easy to use Automated Build Framework! Automated Builds as easy as (1) solution name, (2) source control path, (3) company name for most projects!!! Uppercut was recently called NAnt for the masses! UppercuT is for developers who want a powerful build framework without a lot of set up work. UppercuT is for anyone who needs a standard way of building applications across an entire organization. UppercuT is for anyone who wants to concentrate on just writing code. What can UppercuT ......

AutoTest.NET Changes Now in Source

The changes I made recently to AutoTest.NET have made it back into source control.

Get the code at http://code.google.com/p/autotestnet/source/checkout

Full Code Archive