I've been struggling with this problem, and while something elegant would be preferred any old hack will do at this point :)
I have a repository that is registered something like:
<castle>
<properties>
<myConnStr>Data Source=COMPUTERNAME\SQL2008;Initial Catalog=MyDB;Persist Security Info=True;User ID=username;Password=password</myConnStr>
</properties>
<components>
<component id="MyRepository" service="DomainModel.Abstract.IMyRepository, DomainModel" type="DomainModel.Concrete.MyRepository, DomainModel" lifestyle="PerWebRequest">
<parameters>
<connectionString>#{myConnStr}</connectionString>
</parameters>
</component>
</components>
I am trying to set up my config file so that I don't have to modify the myConnStr property portion for the various deployment options. It's fine (even ideal) if I can only establish the connectionString once when the configuration is first loaded, but I can't figure out how to set this value when setting up my container.
If I wasn't using castle windsor I'd just have multiple connection strings defined like "connectionStringStaging", "connectionStringProduction" and choose the appropriate one via code based on my environment (computer name or URL). How can I do something like that with a castle windsor property? Modifying the 'parameter' for the component instead of the 'property' would be acceptable as well.