Closed Aniketsingh1 closed 8 months ago
@Aniketsingh1 please correct the formatting to ensure all code snippets are correctly formatted using backticks.
@matthewelwell done. Please check.
Thanks, we will take a look and get back to you as soon as we are able to.
Hi @Aniketsingh1, thank you for your patience. While we officially support only .Net Core, our SDK is based on the Standard .Net runtimes, so it is possible to use it with .Net Framework as well, with subtle differences in the implementation depending on the specific version. In your case, could the issue have to do with a dead-lock caused by calling your helper functions from a single thread context like the request thread? Please refer to this document https://devblogs.microsoft.com/dotnet/configureawait-faq/ to manage the async calls properly. Also, we recommend to initialize the client object as a singleton during the app initialization as per our example in the Example folder of the SDK code repo. Another potential issue is that we use HttpClient async requests to get data from the API, which it seems in .Net Framework is missing a call to the ConfigureAwait(false) method, you should be able to solve this issue by following one of the alternative recommendations in the document referred above.
I will close this issue, please contact us in case of any further issues so we can re-open it if needed.
I have incorporated SDK 5.1.0 and implemented the below code in ASP.NET MVC application (not core) which is running on .NET 4.7.2.
I am calling this class post initializing and am trying to get the flagStatus whether it is turned on or off. Like this
Now this code works perfectly fine when it fetches the flag status the very first time but once the second calls comes to get the flag status this piece of code goes in wait and the debugger never returns to the next statement:
var flags = await this._flagsmithClient.GetIdentityFlags(identity, null);
After above code the debugger doesn't return to the code. it's like the thread has gone in infinite wait. I have to reset IIS and start the application again to get rid of this infinite wait issue. Please help me with the fix.