Windsor Integration / AR / Castle

14 views
Skip to first unread message

Adonisc

unread,
Jun 1, 2008, 5:27:38 PM6/1/08
to Castle Project Users
Well i'm new into Monorail development and i having a trouble using
Windsor that doesn't let me test my views and all of that it is
because on the Windsor.boo file or config file i'm making a reference
to the assembly Castle.Monorail.Framework and when i compile the
project it does all fine but when i try to view the changes on my view
throws me an exception of type Boo.Lang.Compiler.CompilerError.

I make a research about it but without any solution still found it and
the only thought that i had it was a bad path reference but i'm not
sure about it.

The exception Detail is: Boo.Lang.Compiler.CompilerError: Could not
compile configuration! Windsor(2,8): BCE0021:
Boo.Lang.Compiler.CompilerError: Namespace 'Castle.MonoRail.Framework'
not found, maybe you forgot to add an assembly reference?

Any Ideas?? I would appreciate a lot the help and thanks in advance

Regards,

Alejandro Donis

Mike Nichols

unread,
Jun 1, 2008, 6:45:37 PM6/1/08
to Castle Project Users
Be sure you have a reference to the Castle.MonoRail.Framework assembly
in the web project.
Also can you disclose the import statement you are using to reference
in your boo file?

Adonisc

unread,
Jun 2, 2008, 12:51:42 AM6/2/08
to Castle Project Users
First of all thanks Mike for your fast answer and well in my web
project i already have the Castle.Monorail.Framework reference and yes
i can show you (all) the import reference in my boo file.

Here it is:

import System.Reflection
import Castle.MonoRail.Framework
import Castle.MonoRail.WindsorExtension

Facility( "rails", MonoRailFacility )

webAsm = ( Assembly.Load("WebProject.Web"),
Assembly.Load("Castle.MonoRail.ViewComponents") )
activeRecordAssemblies = ( Assembly.Load("ModelProject.Model"), )

for asm in webAsm:
for type in asm.GetTypes():
if typeof(Controller).IsAssignableFrom(type):
Component(type.Name, type)
elif typeof(ViewComponent).IsAssignableFrom(type):
Component(type.Name, type)


Component("active_record_repository", IRepository, ARRepository)
Component("active_record_unit_of_work", IUnitOfWorkFactory,
ActiveRecordUnitOfWorkFactory, assemblies: activeRecordAssemblies )

So there it is Mike and also i was reading that maybe that could be
because a trouble of permission that cannot find or load the assembly
in my .NET Framework 2 Config i already set the Machine All Code
Property to Full Trusted that i find in my search of a solution but it
isn't working yet. Thanks in advance

Regards

Mike Nichols

unread,
Jun 2, 2008, 9:37:25 AM6/2/08
to Castle Project Users
Hm...it looks okay to me. When I've come across these kinds of errors
in config and I had done the correct import it was usually because I
didn't have the reference to the assembly in the startup project. Do
you have a reference to the Castle.MonoRail.WindsorExtension assembly
in the web project? I'm stumped

Adonisc

unread,
Jun 2, 2008, 2:55:03 PM6/2/08
to Castle Project Users
Well, i checked and it is there the Windsor Extension assembly i
really don't know how to get over this. The odd thing is that the
error on my boo file it's about the Castle.Monorail.Framework and it
is there in my project so it is kind of confusing i don't know if
works like that or i have to take that assembly to the GAC or take a
copy of it where the boo file resides, do you know if it works adding
this assembly to the web project?
> > > > Alejandro Donis- Hide quoted text -
>
> - Show quoted text -

Mike Nichols

unread,
Jun 2, 2008, 3:24:29 PM6/2/08
to Castle Project Users
Looking back at this:
webAsm = ( Assembly.Load("WebProject.Web"),
Assembly.Load("Castle.MonoRail.ViewComponents") )

I don't understand why you are registering MonoRail components (it's
not necessary). Can you try to remove that and change to this:
webAsm = ( Assembly.Load("WebProject.Web") )

I wonder if that is what is going on...

Adonisc

unread,
Jun 2, 2008, 5:57:48 PM6/2/08
to Castle Project Users
Mmmm im gonna try that Mike, thanks i will let you know.

Really appreciate your help.

Adonisc

unread,
Jun 3, 2008, 10:46:31 AM6/3/08
to Castle Project Users
Mike, it's not working i test what you told me and have the same
problem. Gets me really annoyed i don't know what i have wrong.

Mike Nichols

unread,
Jun 3, 2008, 12:29:45 PM6/3/08
to Castle Project Users
Hm...well you don't need to register those components anyways.
When I have errors in my configuration it is usually because I haven't
written a test to check it out...have you confirmed your configuration
this way, making sure all relevant assemblies are referenced in your
test project? Here are relevant bits from my config that might help:

#castle imports
import Castle.Facilities.Logging
import Castle.Facilities.Startable from Castle.MicroKernel
import Castle.MonoRail.Framework
import Castle.MonoRail.Framework.Services from
Castle.MonoRail.Framework
import Castle.MonoRail.WindsorExtension
import Castle.MonoRail.Framework.Services.Utils from
Castle.Monorail.Framework
import Castle.Core.Logging from Castle.Core
import Castle.Services.Logging.Log4netIntegration from
Castle.Services.Logging.Log4netIntegration

#rhino imports
import Rhino.Commons from Rhino.Commons as commons
import Rhino.Commons from Rhino.Commons.NHibernate as nh
import Rhino.Commons from Rhino.Commons.ActiveRecord as ar

#Load Assemblies
domainAsm = Assembly.Load("Cei.MaterialsTesting")
controllerAsm = Assembly.Load("Cei.MaterialsTesting.Web")
uiAsm = Assembly.Load("Cei.MaterialsTesting.Web.UI")
taskAsm = Assembly.Load("Cei.MaterialsTesting.Tasks")


#Register facilities
facility StartableFacility

facility MonoRailFacility

facility LoggingFacility:
loggingApi = LoggerImplementation.Log4net
configFile = 'logging.config'

facility nh.RhinoTransactionFacility

activeRecordAssemblies = ( Assembly.Load("Cei.Security"),)

#register unit of work
component IRepository, ARRepository
component IUnitOfWorkFactory, ActiveRecordUnitOfWorkFactory:
assemblies = activeRecordAssemblies

redonisc

unread,
Jun 5, 2008, 5:58:12 PM6/5/08
to Castle Project Users
Hey thanks a lot Mike, we solved the problem... how?
Well it just needed import Castle.MonoRail.Framework from
Castle.MonoRail.Framework
After that only these references where missing:
Castle.Components.Common.TemplateEngine.dll,
Castle.Components.Common.EmailSender.dll
And there it was...

I don't now about this but i got really interested in the Castle
stack, and i saw a lot of info from advanced users, but for the new
users is a little confusing all the Windsor integration, may I
suggest:

If some advanced user could share, and merge into daily build a
baseline project that's already wired the active record, Windsor
integration, references, config, etc. Just a template.

Why? because a new user at first, dont want to look all these config
wiring just throw some basic, running site and start gaining
experience on the tools, and may be later with more experience will
care about these possible complications. I now that a unique template
doesn't fit all but share what you have on this matter...
A plus running the latest version from the trunk.

What do you think about it?

Ken Egozi

unread,
Jun 6, 2008, 3:10:15 AM6/6/08
to castle-pro...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages