I am using Autofac for multiple projects and all projects work fine with
Autofac mapped to an external file using the following configuration arguments.
App.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="autofac" type="Autofac.Configuration.SectionHandler, Autofac.Configuration" />
</configSections>
<autofac defaultAssembly="MyAssembly">
<files>
<file name="autofac.config" section="autofac" />
</files>
</autofac>
</configuration>
Autofac.Config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="autofac" type="Autofac.Configuration.SectionHandler, Autofac.Configuration" />
</configSections>
<autofac defaultAssembly="MyAssembly">
<components>
<component service="IComponent, MyAssembly" type="Component, MyAssembly"/>
</components>
</autofac>
</configuration>
When I am using the same configuration from app.config in web.config I receive
the following exception.
[ArgumentException: The configuration section 'autofac' could not be read.]
Autofac.Configuration.ConfigurationSettingsReader..ctor(String sectionName, String configurationFile) +244
Autofac.Configuration.ConfigurationSettingsReader.Load(ContainerBuilder builder) +2862
Autofac.Module.Configure(IComponentRegistry componentRegistry) +59
Autofac.ContainerBuilder.Build(IComponentRegistry componentRegistry) +281
Autofac.ContainerBuilder.Build() +35
I am using Autofac 2.1.13.813. If I do not use an external file and inline the
autofac.config into our web.config file all works as expected. Only when we use
the external file I receive the error.
Original issue reported on code.google.com by Mike737...@gmail.com on 4 Aug 2010 at 2:51
Original issue reported on code.google.com by
Mike737...@gmail.com
on 4 Aug 2010 at 2:51