Replacing MEF with StructureMap

The title of today’s post might sound a little bit provoking, as originally MEF and StructureMap are not meant for the same use cases. However, as there is a great deal of overlapping functionality in StructureMap over MEF (and chances are high one is using an IoC framework anyway), it makes sense to check if […]

How to Write a PowerShell Binary Module – revisited

Module Configuration Variable

Recently I started writing a PowerShell binary module in C# (mainly due to facilitate testing and move away from Pester limitations). In this post I will describe the format of our PowerShell module and the format of the respective Cmdlets, plus logging and testing integration. My first attempt was to create a module for Abiquo […]

[NoBrainer] Using TeamCity Build Parameters with Environment Variables in C#

TeamCitiy Build Configuraiion Environment Variables

When integrating back end systems we very often would like our build server to run integration tests against our test evironments. The problem is that we do not want to hard code any connection uris (or even worse credentials) into our unit and integration tests. As we are using TeamCity as our build server (again […]

[HOWTO] Automatically applying PSDefaultValue to C# based PSCmdlet Parameters

One of the cool features of PowerShell script based Cmdlets is the possibility to define default values for Cmdlet parameters. This is typically done like this: Whenever we invoke such a Cmdlet without specifying the Name parameter the PowerShell runtime will insert the value my default value into that parameter. C# based PSCmdlet provide a […]

Unit Testing C# binary PowerShell Modules

For years all our PowerShell modules we released were script modules (i.e. they were written in PowerShell). However, it is certainly possible to write PowerShell modules in C# as binary modules. Of course there are already plenty discussions whether one or the other approach is better. It really depends on the exact requirements. For us […]

Use Strong Name Key on TeamCity for Digital Signature

We started using strong names for some of our assemblies. Strong named assemblies are assemblies, that get digitally signed with a strong name key to ensure its uniqueness (i.e. in GAC). A strong name consists of the assembly’s identity, culture information (optional), version number plus a public key and a digital signature. As we did […]

[HOWTO] Parsing DateTime with TimeZone information in Newtonsoft.Json

JsonDateTimeZulu

If you have been working with C# and JSON you mmight probably resorted to Newtonsoft.Json, the defacto standard in .NET for handling JSON related data. However, when it comes to parsing date and time related information you might have noticed that the intrinsic JTokenType.Date data type is missing a crucial piece – it does not […]

[NoBrainer] PUT/PATCH/MERGE with OData Service Client

Visual Studio supports the generation of data service clients (Service references) for OData services. A data service client is a .NET class that contains methods for accessing the OData service and gets generated based on the metadata provided by the OData service. The client acts as a proxy and translates the method calls into HTTP […]

[HOWTO] Execute C# build from PowerShell on Jenkins

At d-fens we usually use JetBrains TeamCity as a build server. Because one of our customers uses Jenkins as build server I had the chance to set up a build job for one of our C#/.NET projects on Jenkins. The project I mentioned is a C#/.NET Web Application built with Visual Studio 2013. For testing […]

[HOWTO] Visualize local Service Bus with Service Bus Explorer

In one of our projects we started using Service Bus for Windows Server 1.1. After the installation and configuration we searched for a tool to visualize the local Service Bus instance (i.e. queues, topics, messages, …). One of the tools that allow such a visualization is Service Bus Explorer. First we downloaded and run the […]