Search code examples
nhibernateactiverecordcastle-activerecord

Castle ActiveRecord Mapping problem


As the result of yesterday's discussion , I have decided to use Castle ActiveRecord for my ORM task. I have added attributes to the class according to the starting guide. After fixing some obvious errors, I was greeted with this:

Could not find configuration for CLASS_XXX or its root type Castle.ActiveRecord.ActiveRecordBase this is usually an indication that the configuration has not been setup correctly

Where CLASS_XXX in the error message is one of my c# class name. What is interesting is that CLASS_XXX is different each time I run the code. I have turned on log4net and my log.txt captured nothing. So, I am guessing the error occurred before the process reaches NHibernate.

Following is my CSharp code

        log4net.Config.XmlConfigurator.Configure();

        InPlaceConfigurationSource source = 
                new InPlaceConfigurationSource();


        Assembly asm = Assembly.Load("DomainModel.Entities");

        ActiveRecordStarter.Initialize(asm,source);
        ActiveRecordStarter.CreateSchema();

Any suggestion for finding the real cause of this problem?


Solution

  • Either you're missing the configuration for the InPlaceConfigurationSource (sample) or you need to use a different initialization method.