You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If users were to use the trimming option in .NET 6, one might face this exception if they used Migrate() or MigrateAsync() API.
Could not find method 'AddYears' on type 'System.DateOnly' at System.SharedTypeExtensions.GetRequiredRuntimeMethod(Type type, String name, Type[] parameters)
For now, it can be workaround with adding a line of code (preferably in main class) or using rd.xml
/// <summary>/// FIXME: This is required for EF Core 6.0 as it is not compatible with trimming./// </summary>[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]privatestatic Type _keepDateOnly=typeof(DateOnly);
Include provider and version information
EF Core version: 6.0.0
Database provider: Microsoft.EntityFrameworkCore.Sqlite
Target framework: .NET 6.0
Operating system: Windows 10
IDE: Visual Studio 2022
@jianmingyong I've started to look into this, could you please post a full stack trace of the exception you got with AddYears? I'm specifically interested since that exception was triggered from Migrate.
If users were to use the trimming option in .NET 6, one might face this exception if they used Migrate() or MigrateAsync() API.
For now, it can be workaround with adding a line of code (preferably in main class) or using rd.xml
Include provider and version information
EF Core version: 6.0.0
Database provider: Microsoft.EntityFrameworkCore.Sqlite
Target framework: .NET 6.0
Operating system: Windows 10
IDE: Visual Studio 2022
#26383 #21894
The text was updated successfully, but these errors were encountered: