Views with models from other modules

Topics: Core
Sep 19, 2013 at 3:12 PM
Hi,

In a module I use "UserPartRecord" as a model for a view. It seems that to get it to work I have to keep the "Orchard.Users.dll" in the bin directory of my module.
The thing is I shouldn't have to since I have a dependency on Orchard.Users in my Module.txt.

After looking into Orchard class "DefaultRazorCompilationEvents", I can see that the assemblies loaded to compile a view are only the assemblies found in the bin directory of the module and not those in the modules declared as dependencies.

Isn't that an issue ? If not why ? And what sould I do ?

I have started to take a look at Razor Generator that compiles views into the dll but I really don't like that and anyway it doesn't work because orchard overrides views base class among other things.

Thanks a lot,

Guy
Coordinator
Sep 19, 2013 at 7:52 PM
Always make references to projects, not dlls. The dependency declared in the manifest is different. You need both the reference and the declaration in the manifest.