https://github.com/rafalbielec/feature-switches
Example application which demonstrates how to use features switches / features flags in .NET 9.
https://github.com/rafalbielec/feature-switches
dotnet dotnet9 feature-flags feature-switches feature-toggles net9
Last synced: about 2 months ago
JSON representation
Example application which demonstrates how to use features switches / features flags in .NET 9.
- Host: GitHub
- URL: https://github.com/rafalbielec/feature-switches
- Owner: rafalbielec
- License: mit
- Created: 2024-12-10T23:29:42.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-15T13:50:21.000Z (over 1 year ago)
- Last Synced: 2025-02-06T23:18:24.046Z (over 1 year ago)
- Topics: dotnet, dotnet9, feature-flags, feature-switches, feature-toggles, net9
- Language: C#
- Homepage: https://rafalbielec.com/blog/02_feature_switches
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Feature switches / Feature flags
This is an example solution which demonstrates how to use features switches / features flags in .NET 9. The solution uses both the Microsoft approach to feature flags as well as the OpenFeature NuGet package which you can find here: [OpenFeature.dev](https://openfeature.dev).
## The article
The blog article for this solution is located at [https://rafalbielec.com/blog/02_feature_switches](https://rafalbielec.com/blog/02_feature_switches).
## API URLs
- http://localhost:8080 // The API which uses the Microsoft.FeatureManagement NuGet package.
- http://localhost:8000 // The API to provide flags for the OpenFeature client.
- http://localhost:8001 // The client project which uses the custom OpenFeature API provider.
- http://localhost:8080/openapi/v1.json // OpenAPI JSON spec for the FeatureSwitches project.
- http://localhost:8001/openapi/v1.json // OpenAPI JSON spec for the OpenFeature client API.
### How to run
```sh
cd src
dotnet restore
dotnet build
dotnet run --project FeatureSwitches
dotnet run --project OpenFeatureApp
dotnet run --project OpenFeatureProvider
```
#### IL disassemblers to check compiler trimming
[AvaloniaILSpy](https://github.com/icsharpcode/AvaloniaILSpy/releases)
[IlDasm2](https://github.com/lextudio/dotnet-ildasm2)
#### MultiRun helper tool to run multiple projects at once with one command
```sh
git clone https://github.com/zacharyMcSweenManickchand/MultiRun.net.git
cd MultiRun.net
dotnet build -c Release && dotnet pack -c Release
dotnet tool install --global --add-source ./nupkg mrn --version 1.0.0
mrn .
```