EF Core 11: Cannot scaffold C# literals of type 'Microsoft.EntityFrameworkCore.SqlServer.Metadata.Internal.SqlServerFullTextCatalog'

Abierto
#39,599 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
csharp

Línea de trabajo

Start with the SQL Server provider’s full-text catalog metadata and the C# migration scaffolding path shown in the stack trace, especially how design-time literals are generated for annotations. Reproduce by scaffolding a migration with HasFullTextCatalog and the full-text index configuration from the report. Done means migration scaffolding succeeds for this model and the generated migration correctly represents the catalog.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

area-migrations customer-reported
Bug description

After following the sample here https://learn.microsoft.com/en-us/ef/core/providers/sql-server/full-text-search?tabs=ef-core-11#setting-up-full-text-search to add an FTS to my EntityTypeConfiguration, scaffolding the migration fails with an error

Your code
modelBuilder.HasFullTextCatalog("ProcessesCatalog");

        builder.HasFullTextIndex(x => x.Name)
               .UseKeyIndex("PK_Processes")
               .UseCatalog("ProcessesCatalog")
               .UseLanguage(nameof(Process.Name), "German");
Stack traces
System.InvalidOperationException: Cannot scaffold C# literals of type 'Microsoft.EntityFrameworkCore.SqlServer.Metadata.Internal.SqlServerFullTextCatalog'. The provider should implement CoreTypeMapping.GenerateCodeLiteral to support using it at design time.
   at Microsoft.EntityFrameworkCore.Design.Internal.CSharpHelper.UnknownLiteral(Object value)
   at Microsoft.EntityFrameworkCore.Design.Internal.CSharpHelper.<>c__DisplayClass46_0.<Dictionary>b__0(Object key)
   at Microsoft.EntityFrameworkCore.Design.Internal.CSharpHelper.HandleEnumerable(IndentedStringBuilder builder, Boolean vertical, IEnumerable values, Action`1 handleValue)
   at Microsoft.EntityFrameworkCore.Design.Internal.CSharpHelper.Dictionary(Type keyType, Type valueType, IDictionary dict, Boolean vertical)
   at Microsoft.EntityFrameworkCore.Design.Internal.CSharpHelper.UnknownLiteral(Object value)
   at Microsoft.EntityFrameworkCore.Migrations.Design.CSharpMigrationOperationGenerator.Annotations(IEnumerable`1 annotations, IndentedStringBuilder builder)
   at Microsoft.EntityFrameworkCore.Migrations.Design.CSharpMigrationOperationGenerator.Generate(AlterDatabaseOperation operation, IndentedStringBuilder builder)
   at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid3[T0,T1,T2](CallSite site, T0 arg0, T1 arg1, T2 arg2)
   at Microsoft.EntityFrameworkCore.Migrations.Design.CSharpMigrationOperationGenerator.Generate(String builderName, IReadOnlyList`1 operations, IndentedStringBuilder builder)
   at Microsoft.EntityFrameworkCore.Migrations.Design.CSharpMigrationsGenerator.GenerateMigration(String migrationNamespace, String migrationName, IReadOnlyList`1 upOperations, IReadOnlyList`1 downOperations)
   at Microsoft.EntityFrameworkCore.Migrations.Design.MigrationsScaffolder.ScaffoldMigration(String migrationName, String rootNamespace, String subNamespace, String language, Boolean dryRun)
   at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.CreateScaffoldedMigration(String name, String outputDir, String namespace, Boolean dryRun, IServiceProvider services)
   at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.AddMigration(String name, String outputDir, String contextType, String namespace, Boolean dryRun)
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.AddMigrationImpl(String name, String outputDir, String contextType, String namespace, Boolean dryRun)
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.AddMigration.<>c__DisplayClass0_0.<.ctor>b__0()
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.<>c__DisplayClass3_0`1.<Execute>b__0()
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
Verbose output

EF Core version

11.0.0

Database provider

Microsoft.EntityFrameworkCore.SqlServer

Target framework

.NET 11

Operating system

Windows 11

IDE

Visual Studio 2026 Insiders [12409.143]

Lenguaje dominante
C#
Estrellas
14.8k
Forks
3.4k
Merge medio
3 d 18 h
PR fusionados (30 d)
159

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de dotnet/efcore

Todos los issues de dotnet/efcore

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.