okta / okta-sdk-dotnet

A .NET SDK for interacting with the Okta management API, enabling server-side code to manage Okta users, groups, applications, and more.
Other
154 stars 100 forks source link

dotnet8 Okta.Sdk requires Microsoft.Bcl.AsyncInterfaces v7.0.0.0 but doesn't specify the requirement #721

Open twhitex opened 3 months ago

twhitex commented 3 months ago

Describe the bug?

We are on dotnet8. Something in Okta.Sdk relies on Microsoft.Bcl.AsyncInterfaces v7.0.0 or greater but is not specifically requiring this package. Building the project is fine. However, if we run our project and call any Okta.Sdk apis, it will crash until we add a reference to Microsoft.Bcl.AsyncInterfaces v7.0.0 or greater.

What is expected to happen?

Should not receive a runtime error.

What is the actual behavior?

Runtime error when using any Okta.Sdk apis.

Reproduction Steps?

create new dotnet8 console project dotnet new console --name yourprojname

add reference add Okta.Sdk 7.0.6 reference

add the following code to program.cs - replacing yourtoken and yourdomain with the correct parameters using Okta.Sdk.Api; using Okta.Sdk.Client;

var userApi = new UserApi(new Configuration { Token = "yourtoken", OktaDomain = "yourdomain" }); var users = userApi.ListUsers();

run the project error received: Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified. File name: 'Microsoft.Bcl.AsyncInterfaces, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' at Program.<Main>$(String[] args)

Additional Information?

No response

.NET Version

8.0.204

SDK Version

7.0.6

OS version

No comment

bryanapellanes-okta commented 2 months ago

@twhitex I apologize for the delayed response. Thanks for reporting this, I've entered an internal ticket for review and prioritization: OKTA-742391

kdcllc commented 4 weeks ago

@bryanapellanes-okta I am running into the same issue and in addition, I have a console app that that works but in AspNetCore the same code returns (0) and no error.

       var config = new Configuration
        {
            OktaDomain = "",
            Token = ""
        };
        var apiClient = new GroupApi(config);
        var client = await apiClient.ListGroups().ToListAsync(cancellationToken: applicationLifetime.ApplicationStopping);

        logger.LogInformation("Groups: {0}", client.Count);

I verified that this issue is related to https://github.com/okta/okta-sdk-dotnet/issues/736