最新的文檔仍然參考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