From aca1613f33cadacb530273d77e51aa1c8562ea2a Mon Sep 17 00:00:00 2001 From: Jonathan Norris Date: Fri, 7 Aug 2026 14:33:10 -0400 Subject: [PATCH 1/2] docs: document async .NET OpenFeature initialization --- docs/sdk/server-side-sdks/dotnet/dotnet-openfeature.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/sdk/server-side-sdks/dotnet/dotnet-openfeature.md b/docs/sdk/server-side-sdks/dotnet/dotnet-openfeature.md index 623f604e..15dfb8d8 100644 --- a/docs/sdk/server-side-sdks/dotnet/dotnet-openfeature.md +++ b/docs/sdk/server-side-sdks/dotnet/dotnet-openfeature.md @@ -67,7 +67,7 @@ Initialize the DevCycle SDK and set the DevCycleProvider as the provider for Ope ```csharp // Both Cloud, and Local are supported by the OpenFeature Provider. This example uses the Cloud Provider for sake of brevity in the configuration. var devCycleClient = new DevCycleCloudClientBuilder().SetEnvironmentKey(SDK_ENV_VAR).SetLogger(new NullLoggerFactory()).Build(); -OpenFeature.Api.Instance.SetProvider(devCycleClient.GetOpenFeatureProvider()); +await OpenFeature.Api.Instance.SetProviderAsync(devCycleClient.GetOpenFeatureProvider()); FeatureClient oFeatureClient = OpenFeature.Api.Instance.GetClient(); // The evaluation context is an example of a fully populated DevCycleUser. The only required value is a bucketing key of `user_id` or `targetingKey` @@ -93,6 +93,10 @@ EvaluationContext ctx = EvaluationContext.Builder() ``` [//]: # 'wizard-initialize-end' +`SetProviderAsync` waits for the provider to finish initializing before it returns. This ensures that the Local Bucketing SDK has downloaded its initial configuration before you evaluate a flag. + +Keep this initialization path asynchronous. Do not block on the returned task with `.Wait()`, `.Result`, or `.GetAwaiter().GetResult()`. Blocking can deadlock applications that use a UI or legacy ASP.NET synchronization context. + ### Evaluate a Variable Use a Variable value by passing the Variable key, default value, and EvaluationContext to one of the OpenFeature flag evaluation methods From c8d548eae17afee69c8c60a424a18f63402685ac Mon Sep 17 00:00:00 2001 From: Jonathan Norris Date: Fri, 7 Aug 2026 14:42:40 -0400 Subject: [PATCH 2/2] docs: clarify provider initialization behavior --- docs/sdk/server-side-sdks/dotnet/dotnet-openfeature.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sdk/server-side-sdks/dotnet/dotnet-openfeature.md b/docs/sdk/server-side-sdks/dotnet/dotnet-openfeature.md index 15dfb8d8..ebe00679 100644 --- a/docs/sdk/server-side-sdks/dotnet/dotnet-openfeature.md +++ b/docs/sdk/server-side-sdks/dotnet/dotnet-openfeature.md @@ -93,7 +93,7 @@ EvaluationContext ctx = EvaluationContext.Builder() ``` [//]: # 'wizard-initialize-end' -`SetProviderAsync` waits for the provider to finish initializing before it returns. This ensures that the Local Bucketing SDK has downloaded its initial configuration before you evaluate a flag. +`SetProviderAsync` waits for the provider to finish initializing before it returns. For Local Bucketing, this includes waiting for the initial configuration to download before you evaluate a flag. Keep this initialization path asynchronous. Do not block on the returned task with `.Wait()`, `.Result`, or `.GetAwaiter().GetResult()`. Blocking can deadlock applications that use a UI or legacy ASP.NET synchronization context.