Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# swilliam 4/25/2007 5:25 PM (edited 4/26/2007 3:32 AM)
Dear All

Using the standard 1.5 binaries, I think I may have found something not quite right with the way classes are loaded during module creations.

I have a variant of the Articles module I have called ArticlesExt which uses the Cuyahoga.Modules.ArticlesExt namespace. There are several modules within this assembly, but they all take a constructor using the interface Cuyahoga.Modules.ArticlesExt.DataAccess.IArticleDao, in common with the standard Articles module (but a different interface, obviously). The related services are registered in the cuyahoga_moduleservice table under different names (obviously).

Depending on which module is first loaded, I can *either* get an instance of my ArticlesExt modules *or* an instance of the standard Articles module. In each case, they both work perfectly, each doing their own thing correctly, but I can never get them *both* working at the same time, the other one throwing an exception saying it can't create a proxy.

I have checked and cannot see any namespace clashes or full class name conflicts. I renamed the main ArticlesExt module and that made no difference. I renamed the service key and that didn't seem to fix it either. Finally, I renamed the new IArticleDao interface and ArticleDao to ILinkArticleDao and LinkArticleDao respectively. This fixed the problem.

Is there something in Castle or the ModuleLoader that is using just the interface/class local name, rather than full name? I suspect what happens is once one interface/service is registered, the other module is picking up the wrong one by mistake.

Has anyone else had any problems with interfaces/services of similar names?

Many thanks

Simon
# mgaerber 4/26/2007 1:38 AM
Hi,

this smells more like a Windsor related issue. In the ModuleLoader class, in the debugger, you might want to step through the method GetModuleFromType which registers any services the module defines.

The standard ArticleModule uses fully qualified names:
INSERT INTO cuyahoga_moduleservice (moduletypeid, servicekey, servicetype, classtype) 
VALUES (@moduletypeid, 'articles.articledao', 'Cuyahoga.Modules.Articles.DataAccess.IArticleDao, Cuyahoga.Modules.Articles', 'Cuyahoga.Modules.Articles.DataAccess.ArticleDao, Cuyahoga.Modules.Articles')

Regards,

Max