Skip to content

Random IndexOutOfRangeException RazorEngine 3.7.3 #331

@zelid

Description

@zelid

Having very strange exception on RazorEngine 3.7.3 that happens randomly in production after upgrade from RazorEngine 3.4.2

System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at System.Collections.Generic.List`1.Add(T item)
   at RazorEngine.Compilation.CrossAppDomainCleanUp.CleanupHelper.RegisterCleanupPath(String path)
   at RazorEngine.Compilation.ExecutionContextLessThread.ActionConv.Call(Boolean data)
   at RazorEngine.Compilation.ExecutionContextLessThread.CallHelperSafeHelper`2.AsAction()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at RazorEngine.Compilation.ExecutionContextLessThread.DefaultCallAction(Action a)
   at RazorEngine.Templating.InvalidatingCachingProvider.CacheTemplate(ICompiledTemplate template, ITemplateKey templateKey)
   at RazorEngine.Templating.RazorEngineService.CompileAndCacheInternal(ITemplateKey key, Type modelType)
   at RazorEngine.Templating.RazorEngineService.GetCompiledTemplate(ITemplateKey key, Type modelType, Boolean compileOnCacheMiss)
   at RazorEngine.Templating.RazorEngineService.GetTemplate(ITemplateKey key, Type modelType, Object model, DynamicViewBag viewbag)
   at RazorEngine.Templating.TemplateService.GetTemplate(String razorTemplate, Object model, String name)
   at RazorEngine.Templating.TemplateService.Parse(String razorTemplate, Object model, DynamicViewBag viewBag, String cacheName)

What can be the reason?

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