{"record":{"id":"06670bd6735e6f1e","repo":"dotnet/efcore","slug":"processing-inputfile-failed-06670b","errorCode":null,"errorMessage":"Processing '{inputFile}' failed.","messagePattern":"Processing '(.+?)' failed\\.","errorType":"exception","errorClass":"OperationException","httpStatus":null,"severity":"error","filePath":"src/EFCore.Design/Scaffolding/Internal/TextTemplatingModelGenerator.cs","lineNumber":130,"sourceCode":"        {\n            if (!string.Equals(options.Language, \"C#\", StringComparison.OrdinalIgnoreCase))\n            {\n                throw new OperationException(DesignStrings.NoContextTemplate);\n            }\n\n            var defaultContextTemplate = new CSharpDbContextGenerator { Host = host, Session = host.Session };\n            defaultContextTemplate.Initialize();\n\n            generatedCode = defaultContextTemplate.TransformText();\n\n            foreach (CompilerError error in defaultContextTemplate.Errors)\n            {\n                _reporter.Write(error);\n            }\n\n            if (defaultContextTemplate.Errors.HasErrors)\n            {\n                throw new OperationException(DesignStrings.ErrorGeneratingOutput(defaultContextTemplate.GetType().Name));\n            }\n        }\n\n        var dbContextFileName = options.ContextName + host.Extension;\n        var resultingFiles = new ScaffoldedModel\n        {\n            ContextFile = new ScaffoldedFile(\n                options.ContextDir != null\n                    ? Path.Combine(options.ContextDir, dbContextFileName)\n                    : dbContextFileName,\n                generatedCode)\n        };\n\n        var entityTypeTemplate = Path.Combine(options.ProjectDir!, TemplatesDirectory, EntityTypeTemplate);\n        if (File.Exists(entityTypeTemplate))\n        {\n            host.TemplateFile = entityTypeTemplate;\n","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/dotnet/efcore/blob/3a2006ef569de08368d59db5e1468aa8f407e4f8/src/EFCore.Design/Scaffolding/Internal/TextTemplatingModelGenerator.cs#L112-L148","documentation":"Thrown when the built-in C# DbContext fallback generator (CSharpDbContextGenerator) reports compile errors while TransformText runs. The reporter already wrote each CompilerError to the operation reporter; this OperationException stops the pipeline so broken code is never written to disk.","triggerScenarios":"GenerateModel takes the else branch (no custom DbContext.t4, C# language) and defaultContextTemplate.Errors.HasErrors is true after TransformText().","commonSituations":"The model produced by reverse engineering contains constructs the bundled C# generator cannot render (rare; usually a sign of a provider/EFCore.Design version mismatch or an exotic annotation). Also seen with internal/preview builds where the code generator is ahead of the model conventions.","solutions":["Check the reporter output above this error for the underlying CompilerError messages and address each.","Align EFCore.Design and the database provider to the same release; rebuild and re-scaffold.","Provide a custom DbContext.t4 to take control of context generation and bypass the built-in generator.","Reduce the schema (exclude tables via --table filters) to isolate which object triggers the failure, then file an issue with that minimal repro."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { sg.GenerateModel(model, options); }\ncatch (OperationException ex) when (ex.Message.Contains(\"ErrorGeneratingOutput\"))\n{\n    // inspect reporter output above; align provider/design versions\n    throw;\n}","preventionTips":["Keep EFCore.Design and the provider version-aligned to avoid generator/model mismatches.","Capture the reporter output (it lists CompilerErrors) before this exception.","Provide a custom DbContext.t4 to take control of generation if the built-in fails."],"tags":["t4","templating","scaffolding","design-time","code-generation"],"backgroundTag":null,"analyzedSha":"3a2006ef569de08368d59db5e1468aa8f407e4f8","analyzedAt":"2026-08-11T23:42:04.146Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}