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. ......

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 ......

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

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 ......

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 ......

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. ......

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 ......

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 ......

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 ......

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 ......

Nothin but .NET Developer Boot Camp - Wrap up

Over the past few days I have been honored to be at the Nothin but .NET Developer Boot Camp in Philadelphia, PA. I have also been posting updates every day. A few people have asked me if this course is worth it. I would say if you want to be passionate about what you do (or if you already are), then the answer is a resounding YES!! The sheer amount of benefit you get from knowledge and participation, you may feel like you are a bandit making out with only having had to pay the extremely reasonable ......

Nothin but .NET Developer Boot Camp - Day 5

Friday was the last day of the training course and today we went over a couple of patterns and had a discussion on Domain Driven Design. After the discussion, we were released to continue working on our end to end solution. The team I was on (Go Conquistadors!) got all the way down to the database second out of four teams. We were first to have all parts vertical though. Then we started to refine our design even more. And that is where we left the solution on Friday night. People Bowing Out As the ......

Nothin but .NET Developer Boot Camp - Day 4

So you may notice this post is a little late. The course moved to an open format today and the last people left for the night at 4:30 AM. That's 9 AM to 4:30 AM. Basically today we got direction from JP and then formed groups that we worked with all day to implement an end to end solution from the point that we were already at. One of the things you will push yourself for today is understanding fluent interfaces to whatever extent that you can. The other part is how to build them. They are much harder ......

Nothin but .NET Developer Boot Camp - Day Two

Today has been awesome! More of what we learned yesterday, plus more. We got more in depth into certain patterns and have had a huge helping of BDD all day long. The format has been that JP has written the specs and we get the tests to pass. The format looks like it will start to shift to JP doing less and less code and us doing more and more of it. Three Project Solution So one thing I immediately picked up on is the 3 project solution. One of the projects holds all of the automation and automated ......

Nothin but .NET Developer Boot Camp - Day One EOD Update

Today I learned I have a lot to learn! Patterns, Delegates, Lambdas, PSake, Extension Methods, etc, etc, etc. Photo credit to Hikako. So far we have went through patterns and principles. Ones that come to mind are the Strategy Pattern, Static Gateway Pattern, Decorators, and Specification Pattern. We also got into SRP (single responsibility principle), OCP (open closed principle), Composition over Inheritance, BDD (behavior driven design), DDD (domain driven design), and then we talked a little about ......

Nothin but .NET Developer Boot Camp - Day One Midday Update

My brain hurts. That is all.

Delegates FTW!!!!

Going Back to Boot Camp

In 1998 I went through Basic Combat Training for the United States Army. It was 9 weeks of grueling, awesome and exhausting training. It was training that definitely pushed the limits of your body and mind. I learned quite a lot and the training forever shaped the person I am today. Next week, I will have the opportunity to go to Boot Camp again, but this time it will be for .NET development. JP Boodhoo, a great guy who I met at Alt.NET, conducts a course known as Nothin' But .NET Developer Boot ......

Call For Input: Branch Development Syncing Issue

All of the code we write must be tested and accepted by users before it can go into production. Which brings about a unique possibility of a syncing issue when we are doing so in a branch development scenario. The image below is a great reference. Say we have two imaginary branches, one for features and two for production fixes. In reality there would probably be a branch for every production fix and multiple branches for on-going development. The trunk is code that has been released to production. ......

From Zero to Continuous Integration Presentation: Tulsa TechFest 2008

Thanks to all who made it through my talk on Continuous Integration, as it was pretty dry with lots of page refreshing to show changes as we were building. I am thinking this presentation isn't geared towards a fast format or I wasn't quite ready for it. Either way, CI is an important tool to leverage anywhere code is being written, even if it is a dry talk. :D Here are the files and the configuration that show how to connect up to SVN, VSS, TFS, and Vault. Also there is a triggered build in here ......

Enhancing VisualSVN Server to Allow Anonymous Access

Rick Strahl had a great recent post on Running VisualSVN Server for Subversion Source Control. I have been running VisualSVN Server for my repositories for a little while now and especially love how painless the setup is. Not to mention that VisualSVN Server is 100% free! One part that I especially liked was the part I have been missing and that is anonymous access to repositories. I have been thinking about having this for awhile and with Rick's post I was able to allow it: Anonymous Repository ......

SharpZipLib Versus 7-Zip for Large File Sets

Recently I was asked to help out when we had a need to reduce the size of a directory of rolling backups. And when I say size, I am talking around 12GB a day backup sizes. This was already a compressed directory, but I found that if we zip up the folders, we can get even better compression (to the tune of 60+% more room). First note: Windows built-in zipping utility is not so good, it won't even try to compress anything that size. Instead it throws an error. Nice. Basically I started working with ......

Defining MSBuild And NAnt Tasks Together in the SAME Class

I haven't seen ANYONE talk about putting MSBuild together with NAnt. To me, writing two separate classes (one for MSBuild and one for NAnt) is repetition. There may be a reason to keep them separate (and that might have to do with keeping other required assemblies around, i.e. NAnt.Core.dll when just wanting MSBuild), but I have not found a really good reason yet to separate them. If someone does, please let me know. I just made the two play nice together in my last post ......

How to Programmatically Install A Windows Service (.NET) on a Remote Machine (with or without Dependencies) - Part Two

Last time we created WmiService. Now we are going to create the Tasks so that we can call it from the build script. This time we are going to get our Create Service and Delete Service into our Automated Deployment Scripts of MS Build and/or NAnt. Let's define our tasks. The MS Build Tasks <CreateService MachineName="serverName" ServiceName="aService" ServiceDisplayName="A Service" PhysicalLocation="C:\Locati... StartMode="Automatic" UserName="user" Password="password" Dependencies="MSMQ,hlpsvc" ......

Do Not Store Environment Files in Source (i.e. config files) - Just Say No To Environment Files Period

Environment files in source control are a big No No. Environment files are a big No No anywhere. Period. Except one place - where they are used. You should ONLY maintain ONE local environment file. You should only store in source that one file that is needed to run the code locally. If you have a config.DEV, config.TEST, config.PROD, etc. YOU ARE WRONG! Stop this, you are causing yourself more pain! Every time you update one value, you have to update it in several places. You are violating DRY (don't ......

Tools Matter: Automated Builds / Automated Deployments

Recently Oren posted about how Tools Matter. I agree completely (110%!). I remember a time when we didn't have automated builds and most assuredly didn't have automated deployments either. I remember how long it took to get an environment set up. Our testers would ask us to put the latest code in an environment and it would literally take over an hour sometimes to get the environment updated because we would deploy first to a DEV environment and then a TEST environment for them. Then we would have ......

Windows Services: Update Configuration Without Restarting The Service Follow up

I recently posted on How To Receive Configuration Updates without restarting a .NET Windows Service. For some reason it never showed up in Google Reader. I guessed the reader maybe missed it for some reason. Perhaps it was something in the naming of my post. Like I mentioned in the article, it is possible to update the configuration and not have to restart the service. I was interested in learning how when I saw that log4net was doing it. I didn't take quite the same path they did, but I was influenced ......

.NET Windows Services: How to Receive Configuration Updates without Restarting the Service

Something I have been working on recently is a utility that will watch the configuration file and let me know when it changes. It is a work in progress (I am always tweaking code) even though it works now and I am always open for feedback. I was heavily influenced by looking at how log4net implemented the same thing with the XMLConfigurator (although they used a custom way of getting the file). Basics of How to Receive Configuration Updates Without Restarting a Service To start setting up a configuration ......

Inserting into Microsoft SQL Server Database Identity Columns

This came up in a discussion the other day so I thought I would share it. CREATE TABLE dbo.TestIdentity ( ID bigint identity(1,1) --primary key ,[Desc] char(20) ) INSERT INTO dbo.TestIdentity ([Desc]) values ('first') INSERT INTO dbo.TestIdentity ([Desc]) values ('second') SET IDENTITY_INSERT TestIdentity ON --note the identities being inserted INSERT INTO dbo.TestIdentity (ID,[Desc]) values (1200,'id-third') INSERT INTO dbo.TestIdentity (ID,[Desc]) values (1,'id-fourth') -–this works until you set ......

Test Driven Success Story Plus Side Effects of Good Design

Once you understand good design and the benefits, you don't go back. One of our projects at work has nearly 800 tests in it (across 5 test projects). The point isn't that we have 100% test coverage (because I doubt we do). The point is that we know how a method behaves when sent empty and null values, and also for nearly every edge case in addition to the happy path. Most of these are 800 tests are logical unit tests. Some are system integration tests (parts of the system working with each other). ......

Continuous Integration Enhancement : The Broken Build Token!

I thought I would post about this because I find myself putting notes about this in comments here and there. One of our team members bought the rabies plush doll from ThinkGeek a little over a month ago. From the site: Most folks never realize how cute microbes can be when expanded 1,000,000 times and then fashioned into cuddly plush. Until now, that is. Keep one on your desktop to remind yourself that there is an "invisible" universe out there filled with very small things that can do incredible ......

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 ......

RoundhousE – ADO.NET over SMO

One thing most database change management tools use is SQL Server Managment Objects (SMO). Most do that because ADO.NET doesn’t allow the batch statement separator keyword GO in sql statements. So most people write off the ability to use a database change tool for sql server without actually having the sql server installed on the machine that is running the tool. This is not a reality in some organizations, especially when licenses for SQL server are limited. Split the GO Recently, a few guys have ......

Warmup – Getting Started

What if there was a tool out there that could let you specify a structure for a project (visual studio solution + everything else) and save you up to 3+ hours of work every time you started a new project? Warmup was an idea by Dru Sellers to remove all of the setup work required every time you set up a new project. You know, create the solution, add projects, put in your references, etc. Then how about getting the infrastructure for your service/website/console set up as well with things like IoC, ......

Running Tarantino With MSBuild

To set up Tarantino to run you follow the instructions from my last couple of posts. Once you've done that, you set up a file to run the project. This is how you set up your folder structure. Under db are two folders, Create and Update. In MSBuild, all of the required files to run, plus my MSBuild file (tarantino.proj). Here is how you set up a batch file to call MSBuild to run your database updates. This file is named dbdeploy.bat. @echo on SET DIR=%~d0%~p0% C:\WINDOWS\Microsoft.NET\Fr... ......

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 ......

Windows Mobile Phone Bug: Text/SMS messages coming in from 2016 – Need a fix?

If you are seeing text messages coming in from the year 2016 and thinking this is a total WTF (mate?!), put down the phone. There is no need to break the phone. It’s fine. Nearly all WM phones are experiencing this right now. I repeat, there is no need to break the phone! There is a fix for this that requires maybe five minutes of your time. DISCLAIMER: You do this on your own terms. I am in no way liable if you follow these instructions and damage or render useless anything at all including but ......

Two Major Milestones for RoundhousE and UppercuT

This last year I had a focus to get more involved in Open Source (OSS). The year before I had been involved a little by submitting a patch here and there, but 2009 was a big year for me in OSS. I now manage 4 open source projects that have solved a need for me and others. Coming up on the end of the year it was important for me to get some final touches into at least two projects to finish out the year. UppercuT UppercuT (UC), for those of you who have never heard of it, is an automated build tool ......

Lessons In Building An Email Parser

The Classic Infinite Email Loop When building an email parser, one must think about validating an email address that sends you a message. Just because that email address is where the message says it is from does not really mean that is a valid email address. Some of you can already see where I’m going with this. I was building something in Bombali that would respond to emails when receiving them. When Bombali received a message from an address, Bombali would send a response. No checking on the address. ......

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 ......

Full Code Archive