# How to Toggle Features in C# with Feature Flags

DevFeed: [How to Toggle Features in C# with Feature Flags](<https://devfeed.tech/articles/how-to-toggle-features-in-c-with-feature-flags-24989.md>)

Original publisher: [Read original article](<https://codeahoy.com/2021/08/26/how-to-toggle-features-in-c-sharp/>)

Author: umer

Published: 2021-08-26T00:00:00Z

Content type: tutorial

Language: en

Sources: [Code Ahoy - Articles](<https://devfeed.tech/sources/code-ahoy-articles.md>)

Topics: [feature flags](<https://devfeed.tech/topics/feature-flags.md>), [.NET](<https://devfeed.tech/topics/net.md>), [Development](<https://devfeed.tech/topics/development.md>), [web applications](<https://devfeed.tech/topics/web-applications.md>)

Tags: [c-sharp](<https://devfeed.tech/tags/c-sharp.md>), [feature-flagging](<https://devfeed.tech/tags/feature-flagging.md>), [feature-flags](<https://devfeed.tech/tags/feature-flags.md>), [net](<https://devfeed.tech/tags/net.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>), [web](<https://devfeed.tech/tags/web.md>)

## AI overview

This tutorial explains how to use feature flags to toggle functionality in .NET Core web applications. It covers controlling feature visibility independently of deployment, testing features in production, rolling back changes, and gradually releasing features to users.

## Source excerpt

Note: Unlaunch, the feature flagging service referenced in this post, has been shut down. Links to it have been removed. This blog post was contributed by Tuan Nguyen, Software Developer at Getty Images. Using feature flags to release new features to customers is a powerful technique. I have been using feature flags for many years to release features or changes to production safely and with the peace of mind. The releases are done without any ceremony, and the features aren't visible to customers until we turn the feature flag on. Using feature flags to toggle functionality in .NET Core apps is easily achievable using a feature flag management platform. In this tutorial, I'll show you how to toggle features on demand in a simple web application using Unlaunch (Link Removed) to create and manage feature flags. We'll also see how to show or hide our features with a click of a button, without merging branches, rollbacks or deploys. Feature Flags Feature flags allow developers to control who sees new features irrespective of code deployment. For example, developers can deploy a new feature to production environment and keep it hidden from all users (except themselves.) This way, they can do testing on real systems, and when the management is ready to release the feature, they can turn on the feature flag to let the users in on it. To me, here are some of the benefits of using feature flags: Developers eliminate some of the risk knowing they can roll things back instantly if things go wrong. On a few occasions, I rolled back features because of negative impact to KPI we didn't consider before or one of the underlying system wasn't quite ready. Developers can launch the feature on production behind feature flag and show it to product or marketing team for their feedback. QA in production. This doesn't mean that we skipped testing on the 'Dev' environment, but rather launching the feature on production just for the development team give extra boost of confidence. It also a