This project is read-only.

IThemeSelector implementations not getting registered with IoC

Topics: Customizing Orchard
Jul 6, 2011 at 3:43 AM

If I create a new class that implements IThemeSelector it is never registered and never run. Even when adding it to Orchard.Framework project. Any ideas why this would no longer work?



Jul 6, 2011 at 6:38 AM

Ouch :) You should never touch the Orchard.Framework project.

What you need to do is do this in a module or in a theme, and add that file to the project file for that module or theme.

Jul 6, 2011 at 7:28 AM

I did not leave the file in the solution :)  just wanted to test if the IoC was set to check the Framework assembly and register all classes that implemented IThemeSelector. I was under the assumption I could just add a class to Orchard.Web solution that implemented the IThemeSelector and Orchard would pick it up. That did not work so I ended up creating a theme that handled the implementation.

Thanks for the response.

Jul 7, 2011 at 12:21 AM

Well, that would have worked if you had not picked the one part of Orchard that doesn't get dynamically compiled. Pretty much anywhere else and it would have worked fine.