Skip to content

IAuthenticationService.ImplementationType returns Microsoft.AspNetCore.Authentication.AuthenticationServiceImpl instead #2262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
WeiweiCaiAcpt opened this issue Feb 28, 2025 · 4 comments
Labels
bug Identified as a potential bug NET10 .NET 10 release

Comments

@WeiweiCaiAcpt
Copy link

When we run unittest Ocelot by command dotnet vstest with the latest version dotnet-sdk-10.0.100-preview.2.25125.6, it failed with error: The provided expression should be of type Microsoft.AspNetCore.Authentication.AuthenticationService but was Microsoft.AspNetCore.Authentication.AuthenticationServiceImpl.

After investigating, we found that this test failed due to the implementation was refactored in dotnet/aspnetcore#59557 to return a more derived type.

More detailed information about this issue, please refer to this comment:
dotnet/aspnetcore#60645 (comment)

@raman-m
Copy link
Member

raman-m commented Feb 28, 2025

I do not understand your request to the Ocelot team.
All our builds for the develop branch are successful, including the step to run unit tests. So, the Develop Run #3 is green.

Please send a short email message at [email protected] so we can continue the discussion.

@raman-m raman-m added the question Initially seen a question could become a new feature or bug or closed ;) label Feb 28, 2025
@martincostello
Copy link

martincostello commented Feb 28, 2025

The issue is saying that if the tests are run having upgraded the code to .NET 10, then the test referenced in the issue will fail.

If you changed the test as described, then you'll be in a good state for an upgrade after .NET 10 ships in November.

@raman-m
Copy link
Member

raman-m commented Feb 28, 2025

@martincostello Hello, Martin!

The issue is saying that if the tests are run having upgraded the code to .NET 10, then...

However, Ocelot is currently completing the upgrade to .NET 9 only.

If you changed the test as described, then you'll be in a good state for an upgrade after .NET 10 ships in November.

Understood. Thank you. We will keep this in mind.
Since .NET 10 is scheduled for release in November this year, I will postpone resolving this issue until then.
However, if someone submits a PR to resolve this, we will accept it and keep it in a separate release branch.
In any case, I will mark this issue with a special label.

@raman-m raman-m added bug Identified as a potential bug NET10 .NET 10 release and removed question Initially seen a question could become a new feature or bug or closed ;) labels Feb 28, 2025
@raman-m raman-m changed the title IAuthenticationService.ImplementationType returns Microsoft.AspNetCore.Authentication.AuthenticationServiceImpl instead IAuthenticationService.ImplementationType returns Microsoft.AspNetCore.Authentication.AuthenticationServiceImpl instead Feb 28, 2025
@martincostello
Copy link

The same test code works in .NET 9 and .NET 10, so you could change it now and get it out of the way and forget about it. The one line change is already in the linked comment - I would have submitted a PR, but I don't know which of the two suggestions you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Identified as a potential bug NET10 .NET 10 release
Projects
None yet
Development

No branches or pull requests

3 participants