使用外部文件的Microsoft.Extensions.DependencyInjection配置 [英] Microsoft.Extensions.DependencyInjection Configuration using external file
问题描述
我正在使用完整框架"(不是Core)的程序中使用新的Microsoft.Extensions.DependencyInjection.在程序内部对其进行配置可以很好地工作.
I'm using the new Microsoft.Extensions.DependencyInjection in a program using the 'full Framework' (not Core). It works fine configuring it inside the program.
我没有找到任何文档,可以使用配置文件从外部进行配置,就像我们在使用Unity时在app.config中所做的那样.
I have not found any documentation if it can be configured externally using a configuration file, as we used to do in the app.config when using Unity.
谢谢.
此致
Alfons Puig
Alfons Puig
Alfons Puig SISinf
Alfons Puig SISinf
推荐答案
Alfons Puig,
Hi Alfons Puig,
Unity可以从XML配置文件中读取配置信息.默认情况下,这是您的应用程序的App.config或Web.config文件.但是,您可以从任何其他XML格式文件或其他源(如果需要)中加载配置信息.
Unity can read configuration information from an XML configuration file. By default, this is the App.config or Web.config file for your application. However, you can load configuration information from any other XML format file or from other sources if required.
本主题的以下各节更详细地描述了Unity Application Block的配置:
The following sections of this topic describe the configuration of the Unity Application Block in more detail:
Configuring Containers at Design Time
- Configuring Containers at Run Time
- Configuration Support for Arrays
- Configuration Support for Generics
- Streamlining Injection Configuration By Using PolicyDefinition API
- Unity Configuration Schematic
- Source Schema for the Unity Application Block
最诚挚的问候,
克里斯汀
这篇关于使用外部文件的Microsoft.Extensions.DependencyInjection配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!