Why doesn't interface inheritance work when writing shell extensions in c#?
- by Factor Mystic
According to this article about writing shell extensions in .Net, inheriting the shell interfaces as you might naturally do when writing code doesn't work. I've observed this in my own code as well.
Doesn't work:
public interface IPersist {
// stuff specific only to IPersist
}
public interface IPersistFolder : IPersist {
// stuff specific only to IPersistFolder
}
Does work:
public interface IPersistFolder {
// stuff specific to IPersist only
// stuff specific to IPersistFolder only
}
The article notes this fact:
Lo and behold, it worked! Notice that
I've abandoned any idea that
IPersistFolder is inherited from
anything at all and just included the
stubs from IPersist right in its
definition. In all candor, I can't
tell you why this is but it definitely
works just fine and shouldn't give you
any problems.
So my I'll ask the question this guy didn't know; why didn't the original code work?