Autofac,缺少升级到版本4.0.0的ConfigurationSettingsReader [英] Autofac, upgrade to version 4.0.0 is missing ConfigurationSettingsReader

查看:240
本文介绍了Autofac,缺少升级到版本4.0.0的ConfigurationSettingsReader的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最新文档仍然引用了ConfigurationSettingsReader类,该类似乎已从更新的Autofac.Configuration程序集中丢失.

The latest documentation still refer's to the ConfigurationSettingsReader class which seems to be missing from the updated Autofac.Configuration assembly.

如何在 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程序集是唯一依赖于框架版本4.5.1而非4.5的autofac程序集

the new autofac.configuration assembly is the only autofac assembly dependent on framework version 4.5.1, and not 4.5

推荐答案

Autofac.Configuration的4.0版本仅 支持Microsoft.Extensions.Configuration的配置方式.在4.0版本中没有ConfigurationSettingsReader,配置XML也没有与以前相同的格式.

The 4.0 version of Autofac.Configuration only supports the Microsoft.Extensions.Configuration manner of configuration. There is no ConfigurationSettingsReader in the 4.0 version nor is the configuration XML the same format as it used to be.

我已经更新了文档,以使这一点更加清楚.抱歉造成混乱.

Core Autofac和相关的集成库最初是在.NET 4.5.1+支持下发布的.这是出于多种原因,包括一些依赖项和在开发过程中仅支持.NET 4.5.1的测试库.

Core Autofac and the dependent integration libraries were originally all released at .NET 4.5.1+ support when .NET Core was released. This was for a variety of reasons including some dependency and testing libraries only supporting .NET 4.5.1 during development.

从那时起,核心Autofac和几个集成库就可以支持.NET 4.5了,但是这种更改很难实现.并非所有的集成库都可能返回.我为实现.NET 4.5兼容性而推送了 v4.0.1的Autofac.Configuration . ..

Since then, core Autofac and a couple of the integration libraries have been able to go back and support .NET 4.5 but that change is slow to trickle through. It may not be possible for all the integration libraries to go back. I pushed v4.0.1 of Autofac.Configuration for .NET 4.5 compatiblility...

如何:

.NET 4.5 IS NO LONGER SUPPORTED BY MICROSOFT. You will start running into more of these incompatibility issues with Autofac and other dependencies if you decide not to upgrade to .NET 4.5.2 or higher. I would strongly recommend doing that as soon as you can so you don't run into further issues.

这篇关于Autofac,缺少升级到版本4.0.0的ConfigurationSettingsReader的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆