Skip to content
This repository has been archived by the owner on Apr 22, 2019. It is now read-only.

2 properties are not implemented #2

Open
ArsenShnurkov opened this issue Feb 13, 2017 · 0 comments
Open

2 properties are not implemented #2

ArsenShnurkov opened this issue Feb 13, 2017 · 0 comments

Comments

@ArsenShnurkov
Copy link

ArsenShnurkov commented Feb 13, 2017

,/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.

co-variant return types,

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/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant