Skip to content

More context in template engine crashes #9317

@adrianm64

Description

@adrianm64

Is your feature request related to a problem? Please describe.

I'm maintaining a couple of templates and sometimes the template engine crashes and stops on some file.

The detailed log just says

...
[2025-09-09 09:55:41.597] [Debug] [Microsoft.TemplateEngine.Edge.Template.TemplateCreator] => [Execute] => [Template content generation]: Template content generation finished, took 90 ms
Failed to create template.
Details: Error while processing file /src/MyTemplate/doc.md
Object reference not set to an instance of an object.

Often I can work out what the problem is, e.g. unbalanced #if, but not always.

Describe the solution you'd like.

Would it be possible to include more context in the error message? At least a stack trace which gives some kind of hint of what the problem is.

Not interested in a solution for the specific case with the markdown file above (I just removed it from the template), but for future problems.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions