Skip to main content
Question

C# SDK v8.0.0.0 No longer Synchronous-Safe

  • October 17, 2024
  • 2 replies
  • 63 views

Forum|alt.badge.img+2

Just updated from version 5.3 to version 8 of C# esign SDK (integrating w/ .NET Framework 4.8 MVC App) to take advantage of “IncludeAnchorTabLocations”.
Didn’t realize it would mean completely rewriting everything to use async since the synchronous methods now just call the async method .GetResult()

public OAuth.OAuthToken RequestJWTUserToken(string clientId, string userId, string oauthBasePath, byte[] privateKeyBytes, int expiresInHours, List<string> scopes = null)
        {
            CancellationTokenSource cts = new CancellationTokenSource();
            return TryCatchWrapper(() => RequestJWTUserTokenAsync(clientId, userId, oauthBasePath, privateKeyBytes, expiresInHours, scopes, cts.Token).ConfigureAwait(false).GetAwaiter().GetResult());
        }
comparison of v7 (synchronous-safe) w/ v8 (synchronous-unsafe)

Took me way too long to figure out why the application was hanging. Warning to anyone out there upgrading to v8 -- beware of deadlocks if you’re not using the async methods!

2 replies

Forum|alt.badge.img+4

Hi,

Thank for your confirming the issue, I can see there is already a reported issue on the github repository: https://github.com/docusign/docusign-esign-csharp-client/issues/454

Upgrading to use async methods will resolve the issue but will have that issue raised to resolve it in the future.


Forum|alt.badge.img+3
  • New Voice
  • 5 replies
  • January 8, 2025

Maybe DocuSign could update their documentation to show this? Your documentation for using RequestJWTUserToken still references ApiClient. That would at least mitigate some of the developer frustration.