[英]ConfigurationManager.GetSection does not inherit from System.Configuration.IConfigurationSectionHandler
in a project .netstandard 2.0 I receive this exception在 .netstandard 2.0 项目中,我收到此异常
System.Configuration.ConfigurationErrorsException: 'An error occurred creating the configuration section handler for mySection: Type 'Custom.Config.Configurator' does not inherit from 'System.Configuration.IConfigurationSectionHandler'. System.Configuration.ConfigurationErrorsException:“为 mySection 创建配置节处理程序时出错:类型“Custom.Config.Configurator”不继承自“System.Configuration.IConfigurationSectionHandler”。
when I use当我使用
System.Configuration.ConfigurationManager.GetSection("mySection");
The section is the following部分如下
<section name="mySection" type="Custom.Config.Configurator, Custom" />
It seems the System.Configuration.ConfigurationManager doesn't work as I expected, before the project was in .NET framework and it worked.在项目位于 .NET 框架之前,似乎 System.Configuration.ConfigurationManager 无法正常工作,并且可以正常工作。 I installed System.Configuration.ConfigurationManager 6.0.0.0 and the IConfigurationSectionHandler is implemented.我安装了 System.Configuration.ConfigurationManager 6.0.0.0 并实现了 IConfigurationSectionHandler。
After troubling two days I put the code of System.Configuration.ConfigurationManager.GetSection("mySection");
经过两天的困扰,我把System.Configuration.ConfigurationManager.GetSection("mySection");
in .NET framework project.在 .NET 框架项目中。
Likely System.Configuration and System.Configuration.ConfigurationManager don't work together very well System.Configuration 和 System.Configuration.ConfigurationManager 可能不能很好地协同工作
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.