Hi Pat,

This blog post should help you:
http://mikehadlow.blogspot.com/2010/02/10-advanced-windsor-tricks-9.html

Cheers,
John




________________________________
From: pmcg <[email protected]>
To: Castle Project Users <[email protected]>
Sent: Fri, 13 August, 2010 3:26:10 AM
Subject: Mixing external configuration with fluent registration

I'm trying to figure out how I can reference external configuration
properties (i.e. Database connection strings, log paths etc.), which
will be constructor parameters for components I am registering with
the fluent registration. When using xml configuration I would simply
have configured them as properties within the configuration file. When
configuring a component I would simply have configured the constructor
parameter using the #{propertyname} type syntax. I have tried this
with Depends and Parameters methods, but neither have worked.
Is it possible to use property values that have been defined within a
configuration file when the container was being created? Or are the
properties just available when constructing the container from the
configuration file?
I have seen examples where a configuration component is configured
within the configuration file and can then be passed as a constructor
parameter to other components that depend on the properties. This
requires one or more configuration types, which I would prefer not to
use. Would be nice to just inject the property values which are very
often distinct configuration items.

See these for examples of such configuration holding types
http://mikehadlow.blogspot.com/2010/02/10-advanced-windsor-tricks-9.html
http://ayende.com/Blog/archive/2008/12/31/didja-know-merging-windsor-configuration-with-automatic-registration.aspx


I can always fall back on programmatically accessing properties from
the app settings section of my application configuration file when
doing my fluent registration, but if someone has managed to use
properties defined in the configuration file while registering the
components using the fluent registration I would appreciate any advice

Thanks in advance
Pat

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.


      

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en.

Reply via email to