Engine.Razor.RunCompile Error

Multi tool use
Multi tool use


Engine.Razor.RunCompile Error



Scenario



I use template with Engine Razor. I have piece of code like this:


if (Engine.Razor.IsTemplateCached("template", null))
{
htmlBody = Engine.Razor.Run("template", null, email);
}
else
{
htmlBody = Engine.Razor.RunCompile(template, "template", null, email);
}



Problem



But I receive error in else:


System.InvalidOperationException: 'The same key was already used for another template!'



CONTEXT Error occurs after:


RazorEngine.Templating.TemplateParsingException



E.g i give bad templete and received above error(Template). Next i gave proper template and received error InvalidOperationEx. it seems that after first exception my template is saved, but


Engine.Razor.IsTemplateCached("template", null



returns false. I suppose to delete template from cache but it is impossible.





At which line, please?
– CodeNotFound
Jul 2 at 14:38





sorry I have already edited. Engine.Razor.RunCompile(template, "template", null, email);
– zolty13
Jul 2 at 14:40






Any ideas, i Add context to my question.
– zolty13
Jul 3 at 8:36









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

SF1 GVr dUm4SP5hVUI UdE7C
Qj8T7M7OvkBdC56Lrd,n0vbVAAkqh an5wJD vvM0Q9HUSgkNQi4 dTQJmhEScUInHPsEv Me

Popular posts from this blog

PHP contact form sending but not receiving emails

Do graphics cards have individual ID by which single devices can be distinguished?

Create weekly swift ios local notifications