user553671
user553671

Reputation:

Default Accessor Needed: Custom ConfigurationSection

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?

Upvotes: 2

Views: 3281

Answers (1)

Barry Colebank Jr
Barry Colebank Jr

Reputation: 1949

drop a ; in the set accessor. set { ; }

Upvotes: 2

Related Questions