I've been struggling to get back in the hang of monoRail since the last time i used it 8-9 months ago with asp.net 1.1..


I've created a vs.net 2005 project with a web site and a class library (so i can debug with F5  ;)  )

The class library was created from the Visual Studio MonoRail Add-In project type whatevah whatevah....

All of my controls are working like a champ but i am getting the all so classical :

An ActiveRecord class ( MyMonoRailBack.Models.User) was used but the framework seems not properly initialized. Did you forget about ActiveRecordStarter.Initialize() ?

I have tested the same active record settings in another project and they worked, as did the models i am working with...


I am initializing it in GlobalApplication.cs here:

        public void Application_OnStart()
        {
            container = new WebContainer();

            IConfigurationSource source = System.Configuration.ConfigurationSettings.GetConfig("activerecord") as IConfigurationSource;

            ActiveRecordStarter.Initialize(source, typeof(User), typeof(AccessLevel));
           
        }

and my web.config file contains the following:


<?xml version="1.0" encoding="utf-8" ?>
<configuration>

  <configSections>
    <section name="monoRail"
            type="Castle.MonoRail.Framework.Configuration.MonoRailSectionHandler, Castle.MonoRail.Framework" />
    <section
            name="castle"
            type="Castle.Windsor.Configuration.AppDomain.CastleSectionHandler, Castle.Windsor" />
    <section
      name="activerecord"
      type="Castle.ActiveRecord.Framework.Config.ActiveRecordSectionHandler, Castle.ActiveRecord" />
  </configSections>

  <monoRail>
    <controllers>
      <assembly>MyMonoRailBack</assembly>
    </controllers>
   
    <viewEngine
            viewPathRoot="views"
            customEngine="Castle.MonoRail.Framework.Views.NVelocity.NVelocityViewEngine,
                Castle.MonoRail.Framework.Views.NVelocity"/>
  </monoRail>

  <castle>
    <include uri="file://facilities.config" />

    <include uri=" file://controllers.config" />
  </castle>

  <activerecord>
    <config>
      <add key="hibernate.connection.driver_class" value=" NHibernate.Driver.MySqlDataDriver" />
      <add key="hibernate.dialect"                 value="NHibernate.Dialect.MySQLDialect" />
      <add key="hibernate.connection.provider "     value="NHibernate.Connection.DriverConnectionProvider" />
      <add key="hibernate.connection.connection_string" value="Database=monorailtest;Data Source=localhost;User Id=pfftt;Password=notforyou" />
    </config>
  </activerecord>
 
  <system.web>

    <!-- IIS will bitch if you don't turn custom errors mode off! -->
    <customErrors mode="Off"/>
   
    <!-- Required for "F5" support in VS 2005, but we won't be using dynamic compilation anyway -->
    <compilation debug="true"/>

    <httpHandlers>
      <add verb="*" path="*.aspx" type=" Castle.MonoRail.Framework.MonoRailHttpHandlerFactory, Castle.MonoRail.Framework" />
    </httpHandlers>

  </system.web>

</configuration>




At this point I've meesed with so much trying to fix I don't know where to go!  Can anyone point me in the right direction as to what the problem is?



Thanks,

Jeremy


All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
CastleProject-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/castleproject-users

Reply via email to