Skip to content

An expression is too long or complex to compile - CS1647 #36

@hginwala

Description

@hginwala

I saw this exception today in my logs in live environment, We are using this to parse contents for email body. And it threw this randomly after processing some 3/4000 emails.

Xipton.Razor.Core.TemplateCompileException: error CS1647: An expression is too long or complex to compile
at Xipton.Razor.Core.TemplateFactory.CheckCompileResults(GeneratorResults generatorResults, CompilerResults compilerResults, String templateContent, String generatedSource)
at Xipton.Razor.Core.TemplateFactory.CreateAssembly(String resourceName, String rootNamespace, String className, String content, String& generatedSource)
at Xipton.Razor.Core.TemplateFactory.CreateBucket(String reqestedPath)
at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory)
at Xipton.Razor.Core.TemplateFactory.CreateTemplateInstance(String requestedVirtualTemplateName, Boolean throwExceptionOnVirtualPathNotFound)
at Xipton.Razor.TemplateBase.Xipton.Razor.Core.ITemplateController.TryApplyLayout()
at Xipton.Razor.RazorMachine.ExecuteUrl(String templateVirtualPath, Object model, Object viewbag, Boolean skipLayout, Boolean throwExceptionOnVirtualPathNotFound)
at Xipton.Razor.RazorMachine.ExecuteContent(String templateContent, Object model, Object viewbag, Boolean skipLayout)

I tried parsing the same email locally(same model, same template) and it worked.
this is the version that we are using - Xipton.Razor.dll, v4.0.30319

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions