Custom Module exception
I created a custom module Using the Josh Morales "Developing Intra-Site Modules in Sitefinity 4" and "Sitefinity 4 Modules Made Simple" videos and accompanying blogs. The code compiles and the module and widget install without error. I was able to load the module admin page and add a couple of entries. Suddenly out of the blue, now when I attempt to view the module admin page I'm getting this less than helpful execption:
I forgot to mention that the module is using the Entity Data Model to read/write to a new SQL Server table in the Sitefinity database. Nothing fancy really, an int for the primary key, a couple of varchar columns, several datetime columns, and a boolean. Mapping details are shown in the attached image.
Hi steve! I too encountered that issue when using the Entity Framework for the data layer. I seem to recall that opening the Data model file (edmx) and saving it, then building the project again fixed that issue, though I needed to do it each time I modified the data model.
another customer reported that deleting the website dll and pdb file (usually SitefinityWebApp.dll) and building the project again (not REbuild, just build it again) to create also appears to work.
I hope this is helpful! I would like to also add that since updating the project to use OpenAccess I never got this issue again :) so it might be worth looking into!
Thanks for the suggestions. I tried both and alas, no joy. I'll look into OpenAccess--don't know much about it so I've got some reading to do.
I'd be curious to know if anyone is using the Entity Framework successfully, and if not, why the videos and example code are using it.
Thanks again -- Steve
I ended up updating the code to use OpenAccess which did in fact solve the problem. I will say that using OpenAccess was very convoluted compared to using the Entity Framework. The OpenAccess docs could have been a bit clearer and it would have been very helpful to have a video on the subject.
Also, I tried using my original data table but OA does some funky column renaming under the hood which caused exception after exception. There wasn't much valuable data in the table so I deleted it and started from scratch.