Skip to content

Upgrade to .NET 10 #413

Closed
Closed

Description

@monkeyK1n9

Is your feature request related to a problem? Please describe.

I was frustrated when I upgraded my projects to .NET 10 and their dependency on EFCore 10, but this breaks with the Datasync packages with their EFCore on .NET 9

Describe the solution you'd like
Upgrade to .NET 10

Activity

  1. rahul7720 commented on Nov 24, 2025

    @rahul7720

    After upgrading the MAUI app from .NET 9 to .NET 10 and EF Core to 10, the app now crashes at runtime when using CommunityToolkit.Datasync.Client with offline sync.

    I get this error:

    Method not found: string Microsoft.EntityFrameworkCore.Diagnostics.AbstractionsStrings.ArgumentIsEmpty(object)
    
    Source: Microsoft.EntityFrameworkCore.Relational
    
       at Microsoft.EntityFrameworkCore.RelationalEntityTypeBuilderExtensions.CanSetTable(...)
       at Microsoft.EntityFrameworkCore.RelationalEntityTypeBuilderExtensions.ToTable(...)
       ...
       at Microsoft.EntityFrameworkCore.DbContext.get_Model()
       at CommunityToolkit.Datasync.Client.Offline.OperationsQueue.OperationsQueueManager.GetEntityMap(OfflineDbContext context) in /_/src/CommunityToolkit.Datasync.Client/Offline/OperationsQueue/OperationsQueueManager.cs:line 96
       at CommunityToolkit.Datasync.Client.Offline.OperationsQueue.OperationsQueueManager..ctor(OfflineDbContext context) in /_/src/CommunityToolkit.Datasync.Client/Offline/OperationsQueue/OperationsQueueManager.cs:line 63
       at CommunityToolkit.Datasync.Client.Offline.OfflineDbContext..ctor(DbContextOptions options) in /_/src/CommunityToolkit.Datasync.Client/Offline/OfflineDbContext.cs:line 136
       ...
    

    This worked fine on .NET 9 with the previous EF Core version.

  2. ramatah commented on Nov 25, 2025

    @ramatah

    CommunityToolkit.Datasync.Server.OpenApi version 9.0.5 is also not compatible with ASP.NET Core 10. Using it throws the following exception:

    Unhandled exception. System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
    Method 'TransformAsync' in type 'CommunityToolkit.Datasync.Server.OpenApi.DatasyncOperationTransformer'
    from assembly 'CommunityToolkit.Datasync.Server.OpenApi, Version=9.0.5.0, Culture=neutral, PublicKeyToken=null'
    does not have an implementation.
       at System.Reflection.RuntimeModule.GetDefinedTypes()
       at Microsoft.AspNetCore.Mvc.Controllers.ControllerFeatureProvider.PopulateFeature(IEnumerable`1 parts, ControllerFeature feature)
       at Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartManager.PopulateFeature[TFeature](TFeature feature)
       at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.GetControllerTypes()
       at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.GetDescriptors()
       at Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerActionDescriptorProvider.OnProvidersExecuting(ActionDescriptorProviderContext context)
       at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.UpdateCollection()
       at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.Initialize()
       at Microsoft.AspNetCore.Mvc.Infrastructure.DefaultActionDescriptorCollectionProvider.GetChangeToken()
       at Microsoft.Extensions.Primitives.ChangeToken.ChangeTokenRegistration`1..ctor(Func`1 changeTokenProducer, Action`1 changeTokenConsumer, TState state)
       at Microsoft.Extensions.Primitives.ChangeToken.OnChange(Func`1 changeTokenProducer, Action changeTokenConsumer)
       at Microsoft.AspNetCore.Mvc.Routing.ActionEndpointDataSourceBase.Subscribe()
       at Microsoft.AspNetCore.Builder.ControllerEndpointRouteBuilderExtensions.GetOrCreateDataSource(IEndpointRouteBuilder endpoints)
       at Microsoft.AspNetCore.Builder.ControllerEndpointRouteBuilderExtensions.MapControllers(IEndpointRouteBuilder endpoints)
       ...
    
    System.TypeLoadException: Method 'TransformAsync' in type 'CommunityToolkit.Datasync.Server.OpenApi.DatasyncOperationTransformer'
    from assembly 'CommunityToolkit.Datasync.Server.OpenApi, Version=9.0.5.0, Culture=neutral, PublicKeyToken=null'
    does not have an implementation.
    

    The cause of the issue is that the signature of Microsoft.AspNetCore.OpenApi.IOpenApiOperationTransformer.TransformAsync() changed in ASP.NET Core 10.

    1. In ASP.NET Core 9, the signature was:
      public System.Threading.Tasks.Task TransformAsync(Microsoft.OpenApi.Models.OpenApiOperation operation, Microsoft.AspNetCore.OpenApi.OpenApiOperationTransformerContext context, System.Threading.CancellationToken cancellationToken);
      
    2. In ASP.NET Core 10, the signature is now:
      public System.Threading.Tasks.Task TransformAsync(Microsoft.OpenApi.OpenApiOperation operation, Microsoft.AspNetCore.OpenApi.OpenApiOperationTransformerContext context, System.Threading.CancellationToken cancellationToken);
      

    Notice that the OpenApiOperation class was moved from the Microsoft.OpenApi.Models namespace to the Microsoft.OpenApi namespace.

  3. adrianhall commented on Dec 1, 2025

    @adrianhall
    Collaborator

    Planning on upgrading to dotnet 10 this week - stay tuned.

    Note Datasync 9.x will NOT be compatible with dotnet 10 - there are known issues.

  4. self-assigned this
    on Dec 1, 2025
  5. added
    InfrastructureChanges to the build and release system
    and removed
    Requires TriageThis issue has not been checked by the project team.
    on Dec 1, 2025
  6. added theissue type on Dec 1, 2025
  7. added this to the 10.0.0 milestone on Dec 1, 2025
  8. added 2 commits that reference this issue on Dec 2, 2025
  9. added 2 commits that reference this issue on Dec 3, 2025
  10. added 3 commits that reference this issue on Dec 4, 2025
  11. adrianhall commented on Dec 4, 2025

    @adrianhall
    Collaborator

    Fixed via 949b368 #418

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

InfrastructureChanges to the build and release system

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions