1
Vote

RazorEngine.Parse fails with large base64 encoded images

description

We have been using RazorEngine successfully for many months to create fillable certificates in our system, until recently it appears that we have run into a size related issue with our usage of base64 image encoding.
Attached is the String used in the Razor.Parse call. Both the string and the model are completely valid and filled out.
Regular Razor in MVC has no issues displaying the string on the page as seen in the certeditor.png

The error i receive is “An expression is too long or complex to compile” which points me to the fact that base64 image encoded strings have expression operators in them, and possibly are being handled by the template incorrectly.

If i remove some of the base64 images it starts to work again at a certain point.

Base64 images works fine in other circumstances, but only to a certain size point.

Any help would be appreciated. Is this an issue? or just something that I can change in our code?

file attachments

comments

zihotki wrote Oct 1, 2014 at 11:07 AM