Innovate
Your Software
Faster without Risk

FeatBit, a Fast, Scalable, and Open-source Feature Flags Management Service. For Cloud & Self-hosting.

Innovate Your Software Faster without Risk

FeatBit, a Fast, Scalable, and Open-source Feature Flags Management Service. For Cloud & Self-hosting.

.NET/C# open source feature flags library

Last updated date:

Overview

FeatBit has created a free and open source feature flags library (SDK) for .NET (C#).

This library allows .NET (c#) developers to decouple code deployments from feature releases, giving you control over who sees each feature and when they see it.

This SDK can be used locally in .NET projects with no other dependencies (e.g. network, remote control centre, etc.). It can also be used with a Feature Flags Service Centre that empowers all teams to deliver and control their software.

For more details, the links below will take you to the relevant GitHub repositories:

FeatBit .NET library (SDK) | FeatBit Feature Flags Service Center (Written also in C#)

Installation

The latest stable version is available on NuGet.

dotnet add package FeatBit.ServerSdk

How to use

The following code demonstrates basic usage of FeatBit.ServerSdk.

If the return value of the evaluation function client.BoolVariation() is true, then execute the feature code. Otherwise, run another version of the feature code or do nothing.

More information on FeatBit .NET library (SDK) GitHub repo

Use library locally

You can set up a bootstrap configuration file to define your feature flag strategies. This configuration file can be exported from the UI Portal or the API. An example of configuration file can be found at the following link: Featbit bootstrap file

The configuration file contains all the feature flag release strategies, including individual targeting users, custom rules, reusable segment, etc.

Then load the feature flags config file into your program using FeatBit's dotnet SDK:

using FeatBit.Sdk.Server.Options;

var json = File.ReadAllText("featbit-bootstrap.json");

var options = new FbOptionsBuilder()
    .Offline(true)
    .UseJsonBootstrapProvider(json)
    .Build();

var client = new FbClient(options);

This is also called Offline mode, you can visit offline-mode & Bootstrapping sections in documentation to get more information.

Use library with Feature Flagging Service Center

With a Feature Flags Service Centre, all of the above configuration can be done from the UI. For example, the image below shows how to add beta users to test a feature in production.

The update happens in real time. As soon as you save the feature flag setting in the UI Portal, your .NET library will receives the update and evaluates feature flags with the latest configuration.

Often feature flags are used not only within a .NET application, but in conjunction with the entire product system. For example, in a subscription management scenario for a To-B product, the front-end application and the back-end application may need to share the same feature flag in order to correctly manage entitlements for a particular customer.

This empowers all teams to deliver and control their software.

For more details, the links below will take you to the relevant GitHub repositories:

FeatBit .NET library (SDK) | FeatBit Feature Flagging Service Center (Written also in C#)

Compare with Microsoft FeatureManagement

Microsoft.FeatureManagement integrates cleanly with ASP.NET Core. It supports things like hot reloading and support for easily creating custom filters based on your own application logic/models.

FeatBit's .NET SDK isn't yet tightly integrated with ASP.NET Core, but it does support more flexible custom filters.

It provides more usage scenarios with FeatBit's Feature Flagging Service Centre. In addition to what I mentioned in the "Using the library with Feature Flagging Service Centre" section, FeatBit's .NET SDK can track feature usage insights and custom events. You can export this data to a 3rd party data analysis platform or run the experiments directly in FeatBit.

Conclusion

We've release our first version of .NET feature flags library, we will continuously support more functionnalities and to make it more friendly to C#, .NET, and asp.net core developers.