Friday, September 23, 2016

Azure Service Fabric: Activate an actor on startup

I’m currently working on a project where we are using Azure Service Fabric and the reliable actors component. We had a situation where we wanted to create and activate a set of actors the moment the actor service is started. In our first attempt we added this logic inside the program.cs:

This is actually a bad idea as we are not taking the actor service lifecycle into account. The correct place to activate our actors is inside the RunAsync method of our actor service:

Thursday, September 22, 2016

Fundamentals of Azure: Second Edition

With the fast pace that Microsoft is releasing new features as part of the Azure platform, every Azure book is outdated soon. Michael Collier and Robin Shahan try to keep up and released a second edition of Microsoft Azure Essentials: Fundamentals of Azure.



Download the PDF 

Download the mobile PDF

Download the epub version

Download the mobi version

Wednesday, September 21, 2016

Initialize a net.tcp based WCF service in IIS

Last week I helped a colleague who couldn’t understand why the initialization logic of his WCF service wasn’t invoked. He created a WCF service that he wanted to host in IIS and had put the initialization logic inside the Application_Start method inside the global.asax. The Application_Start method is called when the application is started as part of the ASP.NET pipeline. To be more precisely, it is called when the HttpApplication type is instantiated. This happens when the first HTTP arrives into the application.

However the WCF service wasn’t using HTTP binding but used the net.tcp binding instead(which works perfectly fine in IIS). This also meant that the Application_Start method is never invoked as no HTTP call will ever arrive.

Fortunately, ASP.NET provides a simple hook that works in a protocol agnostic way. The hook is based on the following method:

public static void AppInitialize();

This method can be put in any class that is defined in a C# file in the application’s \App_Code directory. When the AppDomain is started, this method is invoked.

Note: The file must be added to the project as a code file and NOT as part of an assembly.

Tuesday, September 20, 2016

Papers we love

One of my goals for this year is to refresh some of my computer science knowledge. So recently I started to read some scientific papers. While browsing the web searching for some interesting content, I stumbled over

Papers We Love is a repository of academic computer science papers and a community who loves reading them.


Great resource offering hours of reading material!

Monday, September 19, 2016

Nice quote–Simplicity is hard

“I conclude that there are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.”

C.A.R. Hoare

Friday, September 16, 2016

Visual Studio Team Services Hosted Build Agent–Improve build time of your .NET Core applications

When you are using the Hosted build agents(managed for you by Visual Studio Team Services), the agent tries to cache the packages that you are using inside your .NET core app. This makes sense when you re-use the same build agent for multiple builds. But in the situation where you are using the Hosted build agent, you get an agent assigned from a pool meaning that each time you build a different agent can be used. In that case it makes no sense to spend some extra time caching the packages on the machine.

You can disable the caching by setting DOTNET_SKIP_FIRST_TIME_EXPERIENCE environment variable to true on your build machine. This can be done through the variables inside your build definition:


A great tip by Donovan Brown to decrease the time to build your .NET Core applications…

Thursday, September 15, 2016

Awesome Domain Driven Design

Just a quick post with some great content I wanted to share:

Nick Chamberlain started a new Github Repository; awesome-ddd; a curated list of Domain-Driven Design (DDD), Command Query Responsibility Segregation (CQRS), Event Sourcing, and Event Storming resources.

This will certainly become my ‘go-to’ starting point whenever I need to find some information regarding DDD. Thanks Nick!