Permutations of arrays and lists in C#/.Net

For DatenMeister, I needed a class which is capable to return all permutations of a list of elements. After using StackOverflow (what else) and other sources I came up with the following implementation:

Partially, I’m quite happy, that parallism is effective up to 80% on a QuadCore processor, on the other side I’m unhappy about a lot of creations of lists to store the subpermutations.

Getting rid of a list for each call would lead to changing instances and make parallelism much harder. For sake of implementation and reduction of complexity every permutation is created during each call.

As surprise, returning predefined permutations (hard-coded up to level of 3) increased the performance in total by more than 30% and activating parallelism just for arrays larger than 7 elements.

During testing, about 2.000.000 permutations could be returned on a 10-element array. Not absolutely performant, but sufficiently performant.

By the way, this is also the first .Net Standard (1.3) Library I ever created. It is runnable under each operation system.

Factorio – Overview about all resource needs

To have a better understanding about the dependencies between all the resources of the great Factorio Game, I created an Excelsheets containing the dependencies:!AnXOc3Xw-GMPmeAmHZg5IU8Wa9wGeg


Within the next few days, I will build up some simulation tools, which can work upon the data to establish a closed factory with well-defined inputs and outputs.


After some hours of spending into a rudimentary degradation concept, I release the DegradationMeister in version 1.0.

The documentation is available at:

Degradation Concept.pdf@GitHub

This idea is to create a library, which supervises the monitor and automatically calculates the capability of the software dependent on a fixed set of rules.

Function – A function is a well-structured element within a system that has an input/output interface.

Capability – Defines the state describing whether the function is capable to fulfill the task as defined. A function can have several capabilities

Failure – A failure will lead to a state that will lead to a deviation of the intended function in regards to the actual function. There a detectable and non-detectable failures

Failure Cause – A physical event within a physical system or part that leads to a failure.

Monitor – A monitor has the task to detect a failure and report the result of the failure evaluation.

Degrader – The instance that is capable to connect the failures to capabilities and to connect capabilities to other capabilities.


    var degrader = new Degrader(„All“);
    var monitorPowerSupply = new PowerSupplyMonitor(degrader);
    _capabilityPowerSupply = new Capability(degrader, „Power Supply“);
    var monitorActuator = new ActuatorMonitor(degrader);
    _capabilityActuator = new Capability(degrader, „Actuator“);
    _capabilitySystem = new Capability(degrader, „System“);

    degrader.AddDefaultRules(monitorPowerSupply.TotalFailure, _capabilityPowerSupply);
    degrader.AddDefaultRules(monitorActuator.TotalFailure, _capabilityActuator);
    degrader.AddDefaultRules(_capabilityPowerSupply, _capabilityActuator);
    degrader.AddDefaultRules(_capabilityActuator, _capabilitySystem);

Move to Autofac

I left Ninject… Poor guy… Ninject was my favorite dependency container injector, but there is a new hype. The new hype is called ‘Autofac’.

The main reason for the switch was the support of UWP (Universal Windows Platform) and .Net Core. Ninject is still in Beta while Autofac is used also by Microsoft themselves.

So, time to do a switch. The following caveats were found:



Instead of doing a bind to something, you register something as an interface/method.


By default, Autofac does not support the creation of an unregistered, concrete class like Ninject does.

Here, you need to add the following line:


I need the creation of unregistered class, because the DatenMeister uses a plugin-like architecture where the plugins are created by the dependency injection.

In a future version, this class will be replaced by a more specific registration


Autofac differs between the builder, the container and the lifetime scope. In Ninject, this was more or less voluntary. This leads to some architectural changes, since some of the methods used the global builder which is not available after everything has been built. Not nice, but acceptable.


After having built the container, the builder cannot be changed anymore. A new builder has to be created. This also leads to some architectural changes.


In the end… a lot of refactoring without improving the product…

Invoking MsBuild from Powershell

Unfortunately the command ‘msbuild’ is not in the default command line path. This means, that you cannot invoke ‘msbuild’ by just calling ‘msbuild’. You need to find the directory of the .Net-Tools via the registry and use an absolute path.

You could also call your script from the Developer Command Line, but my feeling is that this command line never works as intended.

Another solution is to use a script which does all the look for you:

Invoke-MsBuild does all the dirty work for you.

One example about its usage can be found in my Nuget-Package-Packer packaging NuGet-Package for the NuGet-Package-Repository.

It just works (minor improvements ongoing).

DatenMeister.dll auf Nuget

After a long time of doing nothing, I finally published the DatenMeister.dll in Nuget.

This C# library contains a small interface of the MOF specification as defined by the OMG object group.


It also include a very simple in-memory interface, which is capable to work on the MOF-instances.

In combination with other libraries, it is planned to create a library, which shows somehow a conformance to the MOF and UML specifications.

Of course, the complete library is available within GitHub. (