Theme with included code

Topics: Writing modules, Writing themes
Sep 4, 2011 at 9:39 AM

I'm having this strange issue with my theme. I've generated the theme using codegen with option to create it as a project. My theme includes few .cshtml files and customization to enable .less support. Basically it has some code files and custom web.config under Styles folder to enable dotless handler. Theme works perfectly when running inside the same Orchard instance it was created on but has problems when installed as package to new instance. Basically the project does not get compiled. All .cshtml files work but any custom code my theme project included is not found. Getting a Cannot find file or assembly errors with my theme project name as the thing that was not found. I checked the differences between the instance the theme was created on and where I tried to deploy it. The only difference is that in the dev enviroment the theme is compiled and the MyTheme.dll can be found under App_Data/Dependencies. On the prod environment it cannot be found. If I manually copy the MyTheme.dll file into that folder theme starts working.

Does Orchard compile themes created as projects and deploy the dll files correctly to Dependencies folder?

Coordinator
Sep 5, 2011 at 5:02 AM

It does. Maybe there is something weird in your csproj that prevents dynamic compilation from picking it up. You can try my Vulu Mobile theme for an example of a theme with code.

Sep 12, 2011 at 3:44 PM

I solved this problem by deleting the dependencies.*.xml files. They were correctly repopulated after a restart.