This project is read-only.

StackOverflowException when adding custom Shape for rendering widgets

Nov 29, 2010 at 3:40 PM
Edited Nov 29, 2010 at 3:42 PM


I wanted to create my own widget-rendering shape in custom theme - Widget-AfterContent.cshtml (as stated in docs). I placed it in /Views folder and when tried to run everything crashed with StackOverflowException:/ I'm using current dev branch (as always:)

I'm sure you can repro it - in every theme I'm working currently on the same situation happens. I don't know whether it happens only with widget shapes - I recall having similar situation some time ago when creating custom Menu-rendering shapes.

I'll open an issue for that.

Cheers, Piotr

Nov 29, 2010 at 4:34 PM

Do you have a @Display(Model) in there by any chance? Not sure if there’s anything we can do by 1.0 to protect against that but it is easy to get yourself caught in a recursive @Display like that.


Dec 2, 2010 at 5:10 PM

You were right - I had @Display(Model) in there. Changed it, and it's working now. Thanks!