我对一个简单的微软错误消息感到非常困惑。
当我针对包含自定义 ConfigurationSection 的程序集(该程序集又使用自定义 ConfigurationElement 和自定义 ConfigurationElementCollection,以及多个 ConfigurationProperties)运行 XSD.exe 时,我收到以下错误消息:
错误:处理“Olbert.Entity.Utils.dll”时出错。
- 反映类型“Olbert.Entity.DatabaseConnection”时发生错误。
- 您必须在 System.Configuration.ConfigurationLockCollection 上实现默认访问器,因为它继承自 ICollection。
然而,相关类有一个默认访问器:
public object this[int idx]
{
get { return null; }
set { }
}
我意识到上面没有执行任何操作,但我不需要通过索引访问元素的属性。我只是想解决该错误消息。
那么到底是怎么回事呢?
I am totally confused by a simple Microsoft error message.
When I run XSD.exe against an assembly that contains a custom ConfigurationSection (which in turn utilizes a custom ConfigurationElement and a custom ConfigurationElementCollection, as well as several ConfigurationProperties), I get the following error message:
Error: There was an error processing 'Olbert.Entity.Utils.dll'.
- There was an error reflecting type 'Olbert.Entity.DatabaseConnection'.
- You must implement a default accessor on System.Configuration.ConfigurationLockCollection because it inherits from ICollection.
Yet the class in question has a default accessor:
public object this[int idx]
{
get { return null; }
set { }
}
I realize the above doesn't do anything, but I don't need to access the element's properties by index. I'm just trying to work around the error message.
So what's going on?
发布评论
评论(1)
放下一个;在集合访问器中。放 { ; }
drop a ; in the set accessor. set { ; }