Service Fabric Handbook


This post is a handbook where you probably will find an answer to “How different things works in Azure Service Fabric?” question. Almost all of the information (around 90%) is from docs.microsoft.com, GitHub and etc., the rest of it are personal findings made during development of CoherentSolutions.Extensions.ServiceFabric.Hosting.

Where possible the information will be confirmed by reliable source (docs, issues or posts).

Continue reading “Service Fabric Handbook”

.NET R&D Digest (April, 2019)

There are a lot of good technical articles & books on Web. I see them all the time – when trying to find a solution, when investigating things or simply when reading new posts from my RSS Feed during breakfast.

Having all these knowledge only for myself was a bit selfish. That is why once a month or two I compose some of this content into a so called ‘digest’ for colleagues & friends.

After fourth issues (this one is the fourth) I though – maybe this can be interesting for my readers? So this is the Aprils issue of .NET R&D Digest.

Continue reading “.NET R&D Digest (April, 2019)”

Code Tip: How to work with asynchronous event handlers in C#?

Have you ever faced a need to raise an event in C#? I am almost certain the answer is “Yes, and I have no problems with it“. So did I, but as usual there are some cases when raising events can be tricky.

Imagine a Demo class with single DemoEvent event and Raise method:

public class Demo
  public event EventHandler DemoEvent;

  public void Raise()
    this.DemoEvent?.Invoke(this, EventArgs.Empty);
    Console.WriteLine("All handlers have been executed!");

In Program.Main create a new instance of Demo and subscribe for DemoEvent:

class Program
  static void Main(string[] args)
    var instance = new Demo();
    instance.DemoEvent += (
      eventArgs) =>

Application outputs:

All handlers have been executed!

Everything is fine until someone replaces synchronous event handler with asynchronous one:

// class: Program / Main()
instance.DemoEvent += async (
  eventArgs) =>
  await Task.Delay(10);


All handlers have been executed! 

Oh no! One more post about async-await and event handlers! I am out!

Disappointed reader

(Sound of clapping browser page)

Hey await! Just give me a moment! I am promising not to say anything about when you should or shouldn’t use async-await!

This post is about absolutely opposite thing. Here I want to share a way how you can update Demo class to support both synchronous and asynchronous event handlers.

(Sound of incoming HTTP GET)

Just want to see code? The complete sample (with all the improvements) is available as Gist.

Want to know more? Then let’s dig into.

Continue reading “Code Tip: How to work with asynchronous event handlers in C#?”

CoherentSolutions.Extensions.Configuration.AnyWhere Release 1.0.3

The new release of CoherentSolutions.Extensions.Configuration.AnyWherec is here!

The release 1.0.3 is available on NuGet.

The release notes can be found on project version page.

What’s new?

This release includes minor bug-fix, performance improvement and a new configuration adapter for Azure Key Vault.

Interested? Let’s see the details!

Continue reading “CoherentSolutions.Extensions.Configuration.AnyWhere Release 1.0.3”

“html-escape” – a contributor’s story about Visual Studio Code extension

Have you ever find yourself typing ‘Escape html online‘ in Google search?

I’ve had 🙂

Recently I got tired of these searches and decided to look for an extension to Visual Studio Code, which I use for writing. This is where I met html-escape by Raymond Camden.

I used it for quite awhile a come up with some ideas of how to make it better. The problem was, these improvements required significant design changes. This has made me decide to start contributing.

In this post I invite you to join me in making these design changes. We will take a look at existing application feature set, get acquainted with some of Visual Studio Code concepts and theory, discuss application requirements, create application design (no architectural diagrams) and then literally implement all existing application features fitting them into our design.

Interested? Then let’s start.

Continue reading ““html-escape” – a contributor’s story about Visual Studio Code extension”

CoherentSolutions.Extensions.Hosting.ServiceFabric Release v1.4.0

The new version of CoherentSolutions.Extensions.Hosting.ServiceFabric is released!

The version 1.4.0 is available on NuGet.

The release notes can be found on project version page.

What’s new?

This release brings support for configuration of custom implementation of ICommunicationListener.

Let’s see the details!

Continue reading “CoherentSolutions.Extensions.Hosting.ServiceFabric Release v1.4.0”