Cache is King  |  2014-12-09

The title I stole from the whiteboard and it suited this post pretty good. Although there is nowadays the MemoryCache class I usually implement my own caching solution and this is it: [snippet

We have to talk about Internet Explorer  |  2014-12-02

Since I do work with primarily Microsoft technology I get the requirement from time to time to support Internet Explorer and sometimes it is even spelled out that the development team should focus on IE, overriding the demands of other web browsers. This managerial behavior has the potential of eventually relocating me to a room with padded walls. I will explain why. By way of introduction, there are many reasons behind [.....]

Route debugging with Glimpse  |  2014-11-25

Installation In many MVC projects you come to the point where you have somewhat complex routes and you might want to debug the routing, i.e. be able to tell which one was chosen so you can figure out why. In MVC 4 I used WebApiRouteDebugger but after I started using MVC5 it seems it is not supported anymore and I get an error saying; “[A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to…”. Since [.....]

TFS ERROR MSB3216: Cannot register assembly  |  2014-09-02

Last week I ran into this problem with our deploy chain in TFS 2013 RTM (12.0.21005.1) and I am sure that I am not alone with this problem. In our solution there is an old library that was probably registered for COM interop back in the days, but when I check the project configuration it looks like this: [caption id="attachment_291" align="alignnone" width="609"] Project configuration in Visual Studio [.....]

Setting up AlwaysOn Availability groups with database replication and failover  |  2014-05-13

Image 2 - Failover Clustering successfully installed

This tutorial shows how AlwaysOn Availability Groups can be setup and verified in 10 not so difficult steps. Note that ideally, an availability group should have an odd number of nodes and be more than two although in this example I use two nodes and the quorum disk is located on one of the nodes.   WSCF Feature Installation Since AlwaysOn Availability Groups (referred to as AG from now on) require a Windows Server [.....]

Keenear  |  2013-10-16

As of 2014 I start working with Keenear AB in Sweden

As of January 1st 2014 I am officially departing on a new journey. I expect it to be interesting, frightening, rewarding, diversified but most of all, challenging. Since September I have been part owner of a new software consultant company - Keenear - and with this latest child of mine I intend to spend my days building modern, smart and interesting solutions. Behind the name Keenear, lies the cornerstone values from our [.....]

Implementing an advanced search with Linq filters  |  2013-10-13

This article will cover a very simple demonstration on how we can use Linq to Entities and lazy loading to implement a search functionality that is easy to implement, easily extendable and is relatively fast for anything up to a couple of million rows. If you are looking for a search implementation that should handle more data than that, you ought to look for another solution that is more database central. Naturally, you also [.....]

Data modeling and SQL generation with Enterprise Architect  |  2013-07-18

MSSQL Management Studio

Background The last five year of my professional life I have become more and more interested in Model-Driven Development because of the value it can provide in the elicitation phase of any software development project. As I see it, modeling a potential system beforehand (pre-design) truly facilitates the understanding of what should be produced and it helps architects, designers and developers to identify mistakes before [.....]

Comparing complex objects in C#  |  2013-06-28

If you have ever come across the problem where you have two complex hierarchical objects that you want to compare by aligning all properties on the parent object and all child objects, to determine whether the two are really the same, this piece of code could possibly help you. I have named this small class ObjectCompareUtility and it was used during a migration project, upon discarding of an underlying technology that had [.....]

Thread safe logger  |  2013-06-25

Generally I like the idea of logging to a database rather than a file but when the database is down or unavailable it does not serve as a good solution. For that and many other reasons I have implemented a minimalistic and thread safe Logger that I use in smaller applications and where I don´t expect the file to grow uncontrollably in just a few days. The idea is simple, either set the Uri property first and use the first [.....]

Execute Around Method pattern implemented with Entity Framework  |  2013-06-11

Usually when I come across an implemented data layer it contains a set of GET and SET methods that performs selects, updates and inserts in the database, either through stored procedures or using some other framework which in .NET is usually Entity Framework or Linq-to-SQL. Often when updating and inserting, the queries sent to the database needs to be run in transactions. In a solution I'm currently working on, the data [.....]

First  |  2013-06-05

Although it might not be noticeable I have been working for some time to get this stupid WordPress thingie up and running. I was dumb enough to think that a WordPress template could be relied upon to work out of the box but I had to do some hacking when I was just too tired to debug shitty code. Regardless, it´s finally up - my new creature - It must be #15 in the series of homepage projects. This time [.....]