{"record":{"id":"519dd0ae36b55d47","repo":"dotnet/efcore","slug":"the-project-language-language-isn-t-supported","errorCode":null,"errorMessage":"The project language '{language}' isn't supported by the built-in {service} service. You can try looking for an additional NuGet package which supports this language; moving your DbContext type to a C# class library referenced by this project; or manually implementing and registering the design-time service for the programming language.","messagePattern":"The project language '(.+?)' isn't supported by the built-in (.+?) service\\. You can try looking for an additional NuGet package which supports this language; moving your DbContext type to a C# class library referenced by this project; or manually implementing and registering the design-time service for the programming language\\.","errorType":"exception","errorClass":"OperationException","httpStatus":null,"severity":"error","filePath":"src/EFCore.Design/Design/Internal/LanguageBasedSelector.cs","lineNumber":64,"sourceCode":"    ///     any release. You should only use it directly in your code with extreme caution and knowing that\n    ///     doing so can result in application failures when updating to a new Entity Framework Core release.\n    /// </summary>\n    protected virtual T Select(string? language, IEnumerable<T> services)\n    {\n        if (string.IsNullOrEmpty(language))\n        {\n            language = \"C#\";\n        }\n\n        var legacyService = services.LastOrDefault(s => s.Language == null);\n        if (legacyService != null)\n        {\n            return legacyService;\n        }\n\n        var matches = services.Where(s => string.Equals(s.Language, language, StringComparison.OrdinalIgnoreCase)).ToList();\n        return matches.Count == 0\n            ? throw new OperationException(DesignStrings.NoLanguageService(language, typeof(T).ShortDisplayName()))\n            : matches.Last();\n    }\n}\n","sourceCodeStart":46,"sourceCodeEnd":68,"githubUrl":"https://github.com/dotnet/efcore/blob/3a2006ef569de08368d59db5e1468aa8f407e4f8/src/EFCore.Design/Design/Internal/LanguageBasedSelector.cs#L46-L68","documentation":"The design-time service selector (LanguageBasedSelector) could not find a registered design-time service (e.g. a migrations code generator or model scaffolder) that matches the project's programming language. EF Core ships built-in C# implementations; any other language must be supplied by an additional NuGet package. The selector first tries any legacy service with Language == null, then falls back to a case-insensitive match on the requested language, throwing only when both fail.","triggerScenarios":"Calling LanguageBasedSelector<T>.Select(language) when no registered ILanguageBasedService has a matching Language property. Happens during migrations/code-gen when the project's language (resolved by the design-time host) is something other than 'C#' and no third-party design-time package for that language is installed. Note language defaults to 'C#' when null/empty, so this fires only for an explicit non-C# language with no matching service.","commonSituations":"Running 'dotnet ef migrations add' or 'dbcontext scaffold' against an F# or Visual Basic project without the matching EF Core design-time package (e.g. Microsoft.EntityFrameworkCore.Design F# support); upgrading EF Core and dropping a language-specific design-time package; a custom ILanguageBasedService registered without setting Language.","solutions":["Install the additional NuGet package that provides design-time services for your project's language (e.g. the F# EF Core design-time package) so a matching ILanguageBasedService is registered.","Move your DbContext type into a C# class library referenced by the startup/target project, so the default C# design-time services apply.","Manually implement ILanguageBasedService (e.g. an IMigrationsCodeGenerator) for your language and register it in your IDesignTimeServices configuration."],"exampleFix":"// before: F# startup project, only Microsoft.EntityFrameworkCore.Design installed\ndotnet ef migrations add Initial\n// Throws: project language 'F#' isn't supported\n\n// after: add the F# design-time package\ndotnet add package Microsoft.EntityFrameworkCore.Design\ndotnet add package <F#-design-time-support-package>","handlingStrategy":"validation","validationCode":"// Before design-time work, confirm a service exists for the language\nvar language = /* resolved project language */ \"C#\";\nvar services = designTimeServiceProvider.GetService<IEnumerable<ILanguageBasedService>>();\nif (services != null\n    && services.All(s => !string.Equals(s.Language, language, StringComparison.OrdinalIgnoreCase))\n    && services.All(s => s.Language != null))\n{\n    throw new InvalidOperationException($\"No design-time service registered for language '{language}'.\");\n}","typeGuard":null,"tryCatchPattern":"try\n{\n    var svc = selector.Select(language);\n}\ncatch (OperationException ex) when (ex.Message.Contains(\"isn't supported by the built-in\"))\n{\n    // install the language-specific design-time package or move DbContext to a C# library\n}","preventionTips":["Keep DbContext in a C# class library when using non-C# startup projects.","Install language-specific EF Core design-time packages alongside Microsoft.EntityFrameworkCore.Design.","Pin the design-time package version to match the EF Core runtime version."],"tags":["design-time","migrations","code-generation","language","scaffolding"],"backgroundTag":null,"analyzedSha":"3a2006ef569de08368d59db5e1468aa8f407e4f8","analyzedAt":"2026-08-11T23:42:04.146Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}