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

Aperta
#39,599 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
backend, databases

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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]

Lingua principale
C#
Stelle
14.8k
Fork
3.4k
Merge medio
3g 18h
PR unite (30g)
159

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di dotnet/efcore

Tutte le issue di dotnet/efcore

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.