Help! My build broke after Windows Updates!

On October 14th, 2014, Microsoft released several patches for ASP.NET. Three of these were for MVC, and they had some nasty side effects for the project I’m currently on. I will explain the three snags we hit with this update and how we solved them.

The updates in question are: 2993937 (MVC 3.0), 2993928 (MVC 4.0) and 2992080 (MVC 5.0).

MVC solution won’t compile anymore

This is the most obvious of the three. After installing the update, we got all sorts of compiler errors, like:

Could not locate the assembly "System.Web.Mvc,Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35,processorArchitecture=MSIL"

This error is sort of buried in all kinds of resulting errors:

The type or namespace name 'Controller' could not be found (are you missing a using directive or an assembly reference?)

Continue reading

Persisting business data in MS Workflows

At my current job we have built an application that supports long running processes (up to about 8 months) using Microsoft Workflow Foundation. We have currently made about 15 releases in 2 years, with an ever changing process definition. In this post I will explain one of the most important lessons we have learnt during this time.
Continue reading

Visualizing Team Foundation Server source control history

I thought this was pretty cool:

I wanted to make something like this after seeing a similar visualization of the Minecraft source repository. Obviously it looks a lot better with multiple people working on a long running project, but my employer would probably not appreciate me posting images of their repository. So I used my repository from a little HTML5 Tower Defense game I started earlier this year.

Continue reading

Verifying validity of Workflow Service in Unit Test

Introduction

At work we’ve been having a little bit of trouble verifying that a Workflow Service still “works” after we change something. This is because our custom activities are in a separate assembly. When we change the activities and run MSBuild, we’ll notice that the unit tests still work and that the workflow still compiles. Only after we deploy the service and try to hit it, do we see errors that indicate that the workflow can not be instantiated, for instance because we removed a parameter from an activity. We need some kind of regression testing to prevent this.

To solve this, we now instantiate the workflow in a Unit Test as I will describe in this post.

Problem description

Suppose I have a very simple CodeActivity that takes two values and multiplies them:

public sealed class CodeActivity1 : CodeActivity
{
    public InArgument Input { get; set; }
    public InArgument Factor { get; set; }
    public OutArgument Result { get; set; }

    protected override void Execute(CodeActivityContext context)
    {
        var input = Input.Get(context);
        var factor = Factor.Get(context);

        var result = input*factor;

        Result.Set(context, result);
    }
}

I then have a Workflow Service which calls this activity with a value for Input that it gets from a service call, and a constant value of 3 for the Factor:

workflowservice1
Continue reading