Category Archives: Programming

How to use EndpointCertificate with proper ACL for Network Service in Service Fabric

Presentiments: your Service Fabric cluster must be of version 7.1. Since the automatic rollout was postponed, you would need to temporarily switch to the manual mode, select the latest version, and then switch back once the upgrade is complete. To … Continue reading

Posted in Programming | Tagged | Leave a comment

The benefits of using Arrays over Lists in C#

I’m an ardent proponent of using Arrays (T[]) over Lists (Lisf<T>) in C#. In my case, it’s mostly web services running in Azure and libraries, consumed by such services. In this blog post I’ll be collecting the pros and cons … Continue reading

Posted in Programming | Tagged | Leave a comment

How I started using MediatR and then how I stopped, part 1

This is a series of posts: Part 1 Introduction Handlers, commands and queries MediatR Back to injecting handlers Part 2 Another option: DecoratR Introduction Today I own the Service Fabric infrastructure piece in my team, to run applications and services … Continue reading

Posted in Programming | Tagged , | Leave a comment

Git aliases to combine fetch in the background and checkout/merge/rebase

I decided to write down few useful Git aliases I’m using every day. Or how it looks in .gitconfig:

Posted in Programming | Tagged | Leave a comment

HeartbeatActorServiceType is invalid and cannot be registered. Only ServiceTypes specified in the ServiceManifest can register.

If you try to register an actor within a Service Fabric service like this: but getting the following exception: System.Fabric.FabricException: ‘Invalid Service Type’ Inner Exception: COMException: Exception from HRESULT: 0x80071C21 then in Event Log (Applications and Services Logs -> Microsoft-Service-Fabric … Continue reading

Posted in Programming | Tagged | Leave a comment

Service Fabric and Dependency Injection, part 3: Unit testing

This is a series of blog posts: Part 1: Stateful service Part 2: Stateless service Part 3: Unit testing Unit testing of the final construct we’ve got in previous two parts would be challenging due to a number of reasons: … Continue reading

Posted in Programming | Tagged , | Leave a comment

Service Fabric and Dependency Injection, part 2: Stateless Service

This is a series of blog posts: Part 1: Stateful service Part 2: Stateless service Part 3: Unit testing Update: this approach is incorrect, unfortunately. It actually creates two containers: one to instantiate the service and another to instantiate the … Continue reading

Posted in Programming | Tagged , | 5 Comments

Service Fabric and Dependency Injection, part 1: Stateful Service

This is a series of blog posts: Part 1: Stateful service Part 2: Stateless service Part 3: Unit testing The template of a Service Fabric application that is shipped with Visual Studio instantiates all services explicitly. Like and any other … Continue reading

Posted in Programming | Tagged , | Leave a comment

How to remove ARM resources for Service Fabric application and service using PowerShell

First you need to remove the resource corresponding to the application itself: And then the resource corresponding to the service:

Posted in Programming | Tagged , , | Leave a comment

How to call LINQ extension methods such as Where and ToDictionary using PowerShell

If you have IEnumerable<XElement> and want to call various LINQ extension methods such as Enumerable.Where() or ‚Äč‚ÄčEnumerable.ToDictionary() on it using PowerShell then first load the necessary assemblies: And here’s the code for Where(): and for ToDctionary():

Posted in Programming | Tagged , | Leave a comment