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
I just upgraded to .NET 9 from .NET 8 and now get a new warning in my logs: "The type '{entityTypeConfig}' was found while scanning assemblies but could not instantiated because it does not have a parameterless constructor."
While I like the concept for error-catching, I get this for UserOAuthAuthorizationDbConfiguration even its configuration is manually added right before the call to ApplyConfigurationsFromAssembly. It requires an encryption utility, so it will never have a parameterless constructor. Consequently, the warning in the log is just noise. ;)
See my OnModelCreating method of my DbContext class:
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.HasPostgresExtension("uuid-ossp");
modelBuilder.ApplyConfiguration(new UserOAuthAuthorizationDbConfiguration(this.GetService<IEncryptionUtil>()));
var asm = GetType().Assembly;
modelBuilder.ApplyConfigurationsFromAssembly(asm, type => modelBuilder.Model.FindEntityType(type) == null);
}
I just upgraded to .NET 9 from .NET 8 and now get a new warning in my logs: "The type '{entityTypeConfig}' was found while scanning assemblies but could not instantiated because it does not have a parameterless constructor."
While I like the concept for error-catching, I get this for
UserOAuthAuthorizationDbConfiguration
even its configuration is manually added right before the call toApplyConfigurationsFromAssembly
. It requires an encryption utility, so it will never have a parameterless constructor. Consequently, the warning in the log is just noise. ;)See my
OnModelCreating
method of my DbContext class:This seems related to #19691, #32577 and #24748
I believe the
ApplyConfigurationsFromAssembly
should skip any already loaded configurations.Include provider and version information
EF Core version: 9.0.0
Database provider: Npgsql.EntityFrameworkCore.PostgreSQL 9.0.2
Target framework: .NET 9
Operating system: Windows 11 Pro
IDE: Jetbrains Rider
The text was updated successfully, but these errors were encountered: