{"action":"created","issue":{"url":"https://api.github.com/repos/Antaris/RazorEngine/issues/331","labels_url":"https://api.github.com/repos/Antaris/RazorEngine/issues/331/labels{/name}","comments_url":"https://api.github.com/repos/Antaris/RazorEngine/issues/331/comments","events_url":"https://api.github.com/repos/Antaris/RazorEngine/issues/331/events","html_url":"https://github.com/Antaris/RazorEngine/issues/331","id":111140391,"number":331,"title":"Random IndexOutOfRangeException RazorEngine 3.7.3","user":{"login":"zelid","id":179463,"avatar_url":"https://avatars.githubusercontent.com/u/179463?v=3","gravatar_id":"","url":"https://api.github.com/users/zelid","html_url":"https://github.com/zelid","followers_url":"https://api.github.com/users/zelid/followers","following_url":"https://api.github.com/users/zelid/following{/other_user}","gists_url":"https://api.github.com/users/zelid/gists{/gist_id}","starred_url":"https://api.github.com/users/zelid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zelid/subscriptions","organizations_url":"https://api.github.com/users/zelid/orgs","repos_url":"https://api.github.com/users/zelid/repos","events_url":"https://api.github.com/users/zelid/events{/privacy}","received_events_url":"https://api.github.com/users/zelid/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-13T09:20:09Z","updated_at":"2015-10-13T11:03:59Z","closed_at":null,"body":"Having very strange exception on RazorEngine 3.7.3 that happens randomly in production after upgrade from RazorEngine 3.4.2\r\n\r\n```\r\nSystem.IndexOutOfRangeException: Index was outside the bounds of the array.\r\n   at System.Collections.Generic.List`1.Add(T item)\r\n   at RazorEngine.Compilation.CrossAppDomainCleanUp.CleanupHelper.RegisterCleanupPath(String path)\r\n   at RazorEngine.Compilation.ExecutionContextLessThread.ActionConv.Call(Boolean data)\r\n   at RazorEngine.Compilation.ExecutionContextLessThread.CallHelperSafeHelper`2.AsAction()\r\n   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)\r\n   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)\r\n   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n   at RazorEngine.Compilation.ExecutionContextLessThread.DefaultCallAction(Action a)\r\n   at RazorEngine.Templating.InvalidatingCachingProvider.CacheTemplate(ICompiledTemplate template, ITemplateKey templateKey)\r\n   at RazorEngine.Templating.RazorEngineService.CompileAndCacheInternal(ITemplateKey key, Type modelType)\r\n   at RazorEngine.Templating.RazorEngineService.GetCompiledTemplate(ITemplateKey key, Type modelType, Boolean compileOnCacheMiss)\r\n   at RazorEngine.Templating.RazorEngineService.GetTemplate(ITemplateKey key, Type modelType, Object model, DynamicViewBag viewbag)\r\n   at RazorEngine.Templating.TemplateService.GetTemplate(String razorTemplate, Object model, String name)\r\n   at RazorEngine.Templating.TemplateService.Parse(String razorTemplate, Object model, DynamicViewBag viewBag, String cacheName)\r\n```\r\n\r\nWhat can be the reason?"},"comment":{"url":"https://api.github.com/repos/Antaris/RazorEngine/issues/comments/147683883","html_url":"https://github.com/Antaris/RazorEngine/issues/331#issuecomment-147683883","issue_url":"https://api.github.com/repos/Antaris/RazorEngine/issues/331","id":147683883,"user":{"login":"zelid","id":179463,"avatar_url":"https://avatars.githubusercontent.com/u/179463?v=3","gravatar_id":"","url":"https://api.github.com/users/zelid","html_url":"https://github.com/zelid","followers_url":"https://api.github.com/users/zelid/followers","following_url":"https://api.github.com/users/zelid/following{/other_user}","gists_url":"https://api.github.com/users/zelid/gists{/gist_id}","starred_url":"https://api.github.com/users/zelid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zelid/subscriptions","organizations_url":"https://api.github.com/users/zelid/orgs","repos_url":"https://api.github.com/users/zelid/repos","events_url":"https://api.github.com/users/zelid/events{/privacy}","received_events_url":"https://api.github.com/users/zelid/received_events","type":"User","site_admin":false},"created_at":"2015-10-13T11:03:59Z","updated_at":"2015-10-13T11:03:59Z","body":"Maybe this should help?\r\n\r\nhttp://stackoverflow.com/questions/11978064/got-index-out-of-bounds-error-on-list-add-in-c-sharp\r\n\r\nhttp://stackoverflow.com/questions/7193047/multithread-webservice-acessing-and-modifying-list-object-not-threadsafe"}}