-
Notifications
You must be signed in to change notification settings - Fork 4
2 properties are not implemented #2
Description
,/src/Oocx.ACME.IIS/IISChallengeProvider.cs(29,29): Error CS1061: Type 'object' does not contain a definition for 'Applications' and no extension method 'Applications' of type 'object' could be found. Are you missing an assembly reference? (CS1061) (Oocx.ACME.IIS)
./src/Oocx.ACME.IIS/IISChallengeProvider.cs(24,24): Error CS1061: Type 'object' does not contain a definition for 'VirtualDirectories' and no extension method 'VirtualDirectories' of type 'object' could be found. Are you missing an assembly reference? (CS1061) (Oocx.ACME.IIS)
UPD: hm, actually they are implemented - Site.Applications, Application.VirtualDirectories, strange...
UPD2: collection returns 'object' when indexed by string:
public object this[string attributeName]
this is why it gives these errors.
A workaround currently exists in C# for interfaces
we can change the return type to a more specific type, but for class overrides instead of interface implementations.
you can create methods that behave the same as covariant interface methods using explicit implementations:
public interface IA { object Method();}public class B : IA { public string Method() { /* ... */ } object IA.Method() { return Method(); }}// when using these classes:IA a = new B();B b = new B();object ao = a.Method();string bo = b.Method();
https://www.simple-talk.com/blogs/implementing-method-override-covariance-on-c-part-2/