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

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

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

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

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

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

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

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

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

Enter The Dragon: RoundhousE DB Migrations

One of the coolest projects I have been working on is how to solve issues with database versioning and migration. A project dubbed RoundhousE. RoundhousE is an open source automated database deployment (change management) system that allows you to use your current idioms and gain much more. Currently it only supports Microsoft SQL Server, but there are future plans for other databases. It seeks to solve both maintenance concerns and ease of deployment. We follow some of the same idioms as other database ......

Sproc Executing Slow? It Might be This

So you have stored procedure and it’s having issues. When you run it, it returns really fast. When .NET runs it, its like a dog. The first thing you learn about SQL Server is that it has something called ARITHABORT and it is turned on in SQL Management Studio and OFF in ADO.NET. Yeah you heard that right. OFF. So when you find this out, your first thought is WTF, mate?! Why do we have to make this hard on ourselves? Reference post: http://sqladvice.com/blogs/... ......

UppercuT and Mono Migration Analyzer

If you are using UppercuT, you will be pleased to know that it now supports Mono Migration Analyzer (MoMA for short). All you have to do is upgrade. And with the design of UppercuT, we’ve made it super simple to upgrade. How hard is it to upgrade UppercuT? Just drop in the files in your build folder, check for changes to the lib folder (especially in the NAnt directory) and new folders, and then check for any changes to the .bat files and UppercuT.config and you’re done. Mono Migration Analyzer Here ......

UppercuT – Elegant Solution to Strong Naming

Here’s how you can sign a set of assemblies in a project with a key using UppercuT: 1. Open the UppercuT.config file. 2. Change the following to “true”: 3. Done. Did I mention that creates a private key if it is not there as well?! This was from a patch sent in by Dru Sellers. Thanks Dru! With this knowledge you shall build ......

UppercuT Presentation Afterthoughts

The presentation for TopDNUG went pretty well. There were some good questions and back and forth. The room really seemed to come alive when in a matter of less than ten minutes I added UppercuT to two different Open Source projects (Reflexil and Quartz.NET) and had them off of the ground and building. Full builds, too. With versioning, compiling, unit testing, packaging, etc. I also unveiled the new logo for UppercuT: Here is the slide deck: UppercuT Presentation (may need to be renamed to .pptx) ......

UppercuT – Automated Builds - Change is Good

Recently I reported that there were going to be some changes to UppercuT. And there have been. These are a summary of some of the most significant changes: Uppercut now reports it's version. This is helpful to know where you are versus the current version. It also reports the time when it finishes a build. Custom Replacement Tasks are now implemented. This is to add a task to the custom folder that completely replaces the normal workings of the build step it is replacing. A pre or post custom step ......

Universal NAnt Script for Gallio

So Gallio has been out for a little while and I admit that I am a little slow when it comes to looking at new frameworks. I mean there is so much to look at and only so much time in the day allocated to programming. Anyway, there really isn’t much documentation out there yet for using Gallio with NAnt. I am of the thought that is due to all of the people who are really smart with builds are using Rake and/or PSake now. So I set off to create another universal script. This basically follows the conventions ......

UppercuT Undergoing Some Major Changes

I’m slimming it down and rethinking some of the idioms it is currently using. Stay tuned…

UppercuT – Mark an Application Executable to Use More Than 2GB of Memory (Large Address Aware)

If you’ve ever built a .NET application that runs out of memory constantly, it’s because you are hitting a 2GB limit. You may have known about marking an assembly “/largeaddressaware”. You may have not. The process of doing this is actually somewhat easy once you learn about it. You normally just start a Visual Studio Command Prompt (found in Start Menu under Microsoft Visual Studio version/Visual Studio Tools). Then you find the compiled application and run the following command: editbin /largeaddressaware ......

Topeka .NET User Group Meeting – Moved to August 20th

Due to scheduling conflicts, the meeting has been moved to Thursday August 20th.  http://groups.google.com/group/topekadotnet/browse_thread/thread/d8ed379f3b94858

 

Topeka Dot Net User Group (DNUG) Meeting - August 20th, 2009

Topeka DNUG is free for anyone to attend! Mark your calendars now! Speaker Dru Sellers is the Solution Architect for Federal Home Loan Bank in Topeka, KS. He has been programming professionally for over 8 years and spends most of his time in C# and VB.Net, Castle, and junk punches people who 'touch' his database. Topic Object Oriented Databases and other non-relational options Are you tired of writing SQL to maintain your databases? Are you using an object relational mapper and sick of the mapping? ......

.NET Binding Redirects – Updating Referenced Assemblies Without Recompiling Code

I wanted to keep link love – but blog wouldn’t let me keep the link with the .NET in it when I edited it. The link is now here: http://ferventcoder.com/archive/2009/07/19/net-binding-redirects-ndash-updating-referenced-assemblies-without-recompiling-code.aspx

.NET Binding Redirects – Updating Referenced Assemblies Without Recompiling Code

Have you ever seen this error? System.IO.FileLoadException: Could not load file or assembly ‘nameOfAssembly’, Version=specificVersion, Culture=neutral, PublicKeyToken=publicKey’ or one of it's dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) This means you’ve replaced the specific version of the third party assembly with either an earlier or an updated version. The assembly that uses it is compiled to point to a specific ......

log4net Note: Always Keep Your Logs On the Same Server

From what I have seen and used, log4net is one of the best tools out there for implementing logging (the best?)! That said, we noticed something recently that is very interesting. Let’s say you have a service. You keep it running all of the time. You have implemented logging for it. You keep those logs on a separate server for whatever reason. For purposes of discussion the server the service is on is the “app server” and the server the logs are on is the “log server.” When you reboot that log server, ......

UppercuT – Added Pre-Task Hooks for Custom Tasks

Tonight I committed pre-task hooks for custom tasks in UppercuT. What has been available up to this point is only the post-task custom hooks. Now you can hook in before a task runs and run your own custom tasks! This is done the same way as the post run custom tasks. The naming convention here is *.pre.build in the name. For example _compile.pre.build would be the pre-task custom tasks for _compile.build. The post task custom tasks are now moving to a *.post.build naming standard. For now using the ......

Full Code Archive