Try this instead: container = new WindsorContainer(); container.Install(Configuration.FromAppConfig());
Cheers John On Aug 25, 7:33 am, scottm <[email protected]> wrote: > I have a project whose app.config defines my Windsor setup. It's very > simple: > > <configuration> > <configSections> > <section name="AutomaticActionsSettings" > type="AutomaticActions.AutomaticActionsSettings, AutomaticActions"/> > <section name="castle" > type="Castle.Windsor.Configuration.AppDomain.CastleSectionHandler, > Castle.Windsor"/> > </configSections> > <castle> > <components> > <component id="job.processor" > service="AutomaticActions.Domain.IJobProcessor, > AutomaticActions.Domain" type="AutomaticActions.Domain.JobProcessor, > AutomaticActions.Domain" /> > </components> > </castle> > </configuration> > > I'm using NUnit as a test framework, and I want to test that I can > resolve an object (JobProcessor in this case). I am trying to pass the > relative path of the app.config in my test project like this: > > [TestFixtureSetUp] > public void CanResolveJobProcessor() > { > _container = new WindsorContainer(new XmlInterpreter(@".. > \..\..\AutomaticActions\app.config")); > > IJobProcessor processor = _container.Resolve<JobProcessor> > (); > > Assert.IsNotNull(processor); > } > > I know the path is correct because when the file doesn't exist it > throws a file not found exception. And, when I use the container in my > application, it works fine. Here is the error I'm getting: > > DeserializeElement cannot process element configSections > System.Configuration.ConfigurationErrorsException: DeserializeElement > cannot process element configSections > at > Castle.Windsor.Configuration.Interpreters.XmlInterpreter.DeserializeElement > (XmlNode node, IConfigurationStore store) > at > Castle.Windsor.Configuration.Interpreters.XmlInterpreter.Deserialize > (XmlNode section, IConfigurationStore store) > at > Castle.Windsor.Configuration.Interpreters.XmlInterpreter.ProcessResource > (IResource source, IConfigurationStore store) > at Castle.Windsor.WindsorContainer..ctor(IConfigurationInterpreter > interpreter) > > What am I doing wrong here? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
