最新的文档仍然参考ConfigurationSettingsReader
类,似乎从更新的Autofac.Configuration
程序集中缺少。Autofac,升级到版本4.0.0缺失ConfigurationSettingsReader
如何获得此代码的等效功能版本4.0.0。
我有这样的配置:
<section name="dependencies"
type="Autofac.Configuration.SectionHandler, Autofac.Configuration" />
...
<dependencies>
<modules>
<module type="MyModule, MyAssembly.Service" />
</modules>
</dependencies>
和验证码。
// register the application overrides.
container.RegisterModule(new ConfigurationSettingsReader("dependencies"));
另外,
新autofac.configuration组件是唯一autofac组件依赖于框架版本4.5.1,而不是4.5
该文档仍然引用了'Flexibility to Override'段落中的'ConfigurationSettingsReader'。你能用一个新的例子纠正吗? – Ciccio
“4.0之前”部分的文档确实如此。这仍然在4.0之前。 –
呵呵,我没有看到过“pre-4.0”部分......我很抱歉,但我不明白如何在4.0及更高版本中获得配置......我正在尝试遵循快速入门指南,不起作用..你能在那里添加一个完整的例子吗? 这是我想要做的,但它是错误的: https://stackoverflow.com/questions/47454684/read-modules-from-web-config-in-autofac – Ciccio