【发布时间】:2012-08-14 02:01:10
【问题描述】:
我正在尝试访问 Windows 服务应用程序中 app.config 的自定义部分。
这就是我定义部分的方式
<Configurations>
<configSections>
<section name="SectionName" type="ClassName, AssemblyName"/>
</configSections>
<SectionName>...</SectionName>
</Configurations>
我收到以下错误
为
SectionName创建配置节处理程序时出错:无法加载类型“ClassName,AssemblyName,版本=1.0.0.0,文化=中性,PublicKeyToken=null”,因为它不是公共的。
这个错误的可能原因是什么?
【问题讨论】:
-
是的,这门课非常公开。
-
并且它在AssemblyName命名空间中被称为ClassName?
-
是的。无论如何,我解决了我的问题。缺少默认构造函数。对不起,我的坏
标签: windows-services app-config