{"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/dbf9771522148d61a2467854921bd5dc6f6e6916/src/EFCore.Design/Design/Internal/LanguageBasedSelector.cs#L46-L68","documentation":"LanguageBasedSelector.Select found no ILanguageBasedService (e.g. CSharpMigrationsGenerator, CSharpModelGenerator) whose Language matches the project language. EF ships only a C# generator by default; F# and Visual Basic need their own design-time service packages. The default language falls back to 'C#' when none is specified.","triggerScenarios":"A migration/scaffolding operation runs in an F# or VB project whose project language string doesn't match any registered ILanguageBasedService.Language. matches.Count == 0 at line 63 -> throw. Triggered via dotnet ef migrations add / dbcontext scaffold in a non-C# project without the matching EFCore.*.Design package.","commonSituations":"F# project missing Microsoft.EntityFrameworkCore.SqlServer.Design (F#) or an equivalent language-specific design package; VB project with no VB design services; a custom language selector registering the wrong Language string.","solutions":["Install the language-specific design-time package for your provider (e.g. the F# EF Core design services NuGet package).","Move the DbContext to a C# class library and reference it from the F#/VB project, then run dotnet ef from the C# project.","Implement IDesignTimeServices and register a custom ILanguageBasedService for your language.","Check that the project's Language is what you expect (inspect the .csproj/.fsproj <Language> element)."],"exampleFix":"// before: F# project with only C# design services\ndotnet ef migrations add Init   // fails\n// after: register F# services in a DesignTimeServices file\nclass FSharpDesignTimeServices : IDesignTimeServices\n{\n    public void ConfigureDesignTimeServices(IServiceCollection services)\n        => services.AddSingleton<IMigrationsCodeGenerator, FSharpMigrationsGenerator>();\n}","handlingStrategy":"validation","validationCode":"var supported = designServices.Select(s => s.Language).ToList();\nif (!supported.Contains(projectLanguage, StringComparer.OrdinalIgnoreCase))\n    throw new InvalidOperationException($\"Language '{projectLanguage}' unsupported. Supported: {string.Join(\", \", supported)}\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["For F#/VB projects, install the matching EFCore.*.Design language package.","Prefer keeping the DbContext in a C# class library.","If implementing a custom language, register its ILanguageBasedService explicitly."],"tags":["efcore","fsharp","visual-basic","design-time","language"],"analyzedSha":"dbf9771522148d61a2467854921bd5dc6f6e6916","analyzedAt":"2026-08-06T20:46:03.226Z","schemaVersion":2},"datasetVersion":"2026-08-07T03:17:09.362Z"}