Skip to content

OrchardCMS retarget to .Net10 failed with ambiguous call error between custom GetKeyedService() and Microsoft.Extensions.DependencyInjection.ServiceProviderKeyedServiceExtensions.GetKeyedService() #17491

@CancanTang

Description

@CancanTang

Describe the bug

When retargeting OrchardCMS app to .NET 10, it is built failed with CS0212 error

The call is ambiguous between the following methods or properties: 'Microsoft.Extensions.DependencyInjection.ServiceProviderKeyedServiceExtensions.GetKeyedService(System.IServiceProvider, System.Type, object?)' and 'OrchardCore.Environment.Shell.Builders.ServiceProviderExtensions.GetKeyedService(System.IServiceProvider, System.Type, object?)'

After investigation , OrchardCore needs to remove their extension method for .NET 10 .
please refer to dotnet/aspnetcore#60307 to get details

Orchard Core version

To Reproduce

  1. replace net8.0 to net10.0 in src\OrchardCore.Build\Dependencies.AspNetCore.props file.
  2. dotnet publish src\OrchardCore.Cms.Web -f net10.0

Expected behavior

publish successfully

Logs and screenshots

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions