RazorGenerator.Mvc will pick up wrong editor from a type

Aug 23, 2013 at 7:48 AM
Edited Aug 23, 2013 at 7:48 AM
We have a configuration tool which was originally built using normal MVC, but due to programming and merge errors and to decrease initial startup we moved to RazorGenerator. Everything worked fine, until one project (which was several plug-ins to the configuration tool) was moved in an error showed up: RazorGenerator will resolve the wrong editor for a type.

The setup is basically this: the migrated project have a "common" library which consists of models, and editors for these models. However, two other plug-ins overrides these editors with their own, but RazorGenerator seems to just pick one of the other assemblies (arbitrary perhaps?) and show that editor, and not the editor defined in the controller assembly.

Basically we have Html.EditorForModel() and for one of the fields, no editor is visible, and debugging shows that RazorGenerator is picking the wrong view.
Aug 23, 2013 at 7:25 PM
Not sure what's going on here. Any chance you can debug into the RZ sources to help pinpoint the problem?

I wonder if using CompositePrecompiledMvcEngine/PrecompiledViewAssembly instead of PrecompiledMvcEngine would help. It allows RZ to look at the precompiled pages from multiple assemblies at once, rather than sequentially. That can make differences in the resolution.
Aug 26, 2013 at 6:45 AM
I am using CompositeProcompiledMvcEngine, but I thought that perhaps it acts like a "linker" (since it has practically no documentation) so I tried using several PrecompiledMvcEngine, but it had noe effect on the matter.

I think I will do some overtime today and debug into the source code. At this point I have been put on another project as a consultant, so I don't get as much time on this as I would prefer, and no one else seem willing to touch the issue.
Aug 26, 2013 at 9:05 PM
Yes, CompositePrecompiledMvcEngine was recently contributed, and unfortunately has little doc. Though there is starter code commented out in the file that comes with the package.

Anyway, let us know if you figure out what's going on.