{"record":{"id":"0af9471f8377b9e7","repo":"dotnet/efcore","slug":"processing-inputfile-failed","errorCode":null,"errorMessage":"Processing '{inputFile}' failed.","messagePattern":"Processing '(.+?)' failed\\.","errorType":"exception","errorClass":"OperationException","httpStatus":null,"severity":"error","filePath":"src/EFCore.Design/Scaffolding/Internal/CSharpModelGenerator.cs","lineNumber":124,"sourceCode":"            // output EntityType poco .cs file\n            var entityTypeFileName = entityType.Name + host.Extension;\n            resultingFiles.AdditionalFiles.Add(new ScaffoldedFile(entityTypeFileName, generatedCode));\n        }\n\n        return resultingFiles;\n    }\n\n    private string ProcessTemplate(ITextTransformation transformation)\n    {\n        var output = transformation.TransformText();\n\n        foreach (CompilerError error in transformation.Errors)\n        {\n            _reporter.Write(error);\n        }\n\n        return transformation.Errors.HasErrors\n            ? throw new OperationException(DesignStrings.ErrorGeneratingOutput(transformation.GetType().Name))\n            : output;\n    }\n}\n","sourceCodeStart":106,"sourceCodeEnd":128,"githubUrl":"https://github.com/dotnet/efcore/blob/dbf9771522148d61a2467854921bd5dc6f6e6916/src/EFCore.Design/Scaffolding/Internal/CSharpModelGenerator.cs#L106-L128","documentation":"Thrown in CSharpModelGenerator.ProcessTemplate (line 124, resource ErrorGeneratingOutput -> 'Processing {inputFile} failed.') as an OperationException when a T4 text template transformation reports errors. EF scaffolding uses T4 templates (CSharpDbContextGenerator, CSharpEntityTypeGenerator) to produce code; if transformation.Errors.HasErrors is true, the generated output is discarded and this is thrown. The 'inputFile' placeholder is the transformation type name.","triggerScenarios":"Running reverse-engineering/scaffolding where the T4 template (DbContext or entity-type generator) fails to transform, populating transformation.Errors with CompilerErrors. ProcessTemplate writes the errors to the reporter and throws OperationException(DesignStrings.ErrorGeneratingOutput(transformation.GetType().Name)).","commonSituations":"Template errors caused by an unexpected model shape, a provider emitting metadata the template cannot handle, an EF Core version mismatch between the template and the model, or a custom T4 host with missing assemblies. Corrupt/unusual database schema producing model annotations the generator chokes on. Customized scaffolding templates with syntax errors.","solutions":["Read the detailed CompilerError entries reported just before the exception (via the reporter) to find the template's real failure.","Upgrade the EF Core Design package so the bundled templates match your runtime/provider version.","Simplify the schema selection (tables/schemas filter in DatabaseModelFactoryOptions) to isolate which object triggers the template error.","If using custom T4 templates, validate them in isolation; revert customizations to confirm they are the cause."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { generator.GenerateModel(model, options); }\ncatch (OperationException ex) when (ex.Message.StartsWith(\"Processing\"))\n{ /* inspect reported CompilerErrors; fix model/version/templates; retry */ }","preventionTips":["Keep EF Core Design package version aligned with runtime/provider.","Read the CompilerError details reported before the throw.","Scope the schema filter to isolate offending objects.","Validate custom T4 templates separately."],"tags":["ef-core","scaffolding","t4","code-generation","design-time"],"analyzedSha":"dbf9771522148d61a2467854921bd5dc6f6e6916","analyzedAt":"2026-08-06T20:46:03.226Z","schemaVersion":2},"datasetVersion":"2026-08-07T02:17:10.218Z"}