xsd.exe default constructor

  • Thread starter Thread starter Eric Eggermann
  • Start date Start date
E

Eric Eggermann

Hello,
I'm trying to use xsd.exe to create a schema from my exe and I get an error
saying that my collection class does not implement a default accessor which
it must since it inherits from ICollection.

Can anyone explain what xsd is looking for?

TIA,
Eric Eggermann
 
I'm trying to use xsd.exe to create a schema from my exe and I get an error
saying that my collection class does not implement a default accessor which
it must since it inherits from ICollection.

Can anyone explain what xsd is looking for?

I suspect it's looking for a public parameterless constructor.
 
Jon Skeet said:
I suspect it's looking for a public parameterless constructor.

I sussed it. It wasn't the constructor. It wanted an indexer that can be
used like an arrays. I had an item property, with a declaration like

public Card Item(int index)
{
return List[index]
}

It wanted to see:
public Card this [int index]
{
get
}
return List[index]
}
set
{
List[index] = value;
}
}
So that is a default accessor. Got it.

Thanks anyway Jon.

Eric
 
I sussed it. It wasn't the constructor. It wanted an indexer that can be
used like an arrays. I had an item property, with a declaration like

So that is a default accessor. Got it.

Ah, right. Apologies - that's what I get for posting with flu :(
 
Back
Top