在 .NET Framework 4.8(Web 窗体)中,我们必须在 web.config 文件中配置节处理程序
<configuration>
<configSections>
<sectionGroup name="Log">
<section name="logEventSinks" type="BlazorWeb.LogEventSinkSectionHandler, BlazorWeb" />
</sectionGroup>
</configSections>
<Log>
<logEventSinks>
</logEventSinks>
</Log>
执行此行时
ConfigurationManager.GetSection("Log/logEventSinks")
Create方法将被调用IConfigurationSectionHandler
并传递节节点。
IConfigurationSectionHandler
object Create(object parent, object configContext, XmlNode section);
是否可以使用此库在 Blazor 服务器应用程序中执行相同的操作
Microsoft.Extensions.Configuration
? (或)
How to implement
IConfigurationSectionHandler
in Blazor server or is it possible to implement IConfigurationSectionHandler
using appsettings.json
.
请提出解决方案。