Search code examples
c#.netvirtual-earth

Extending a class, compiler complains Microsoft.MapPoint.PlugIns.PlugIn does not contain a


I'm following the tutorial's that come with the SDK for Microsoft Virtual Earth, and when I try to create a plugin like it says, the compiler won't let me.

I'm extending the class Microsoft.MapPoint.PlugIn.PlugIn and it has two abstract methods (that the tutorial doesn't talk about) which I have implemented. However, when I compile it, Visual Studio says

'Microsoft.MapPoint.PlugIns.PlugIn' does not contain a constructor that takes '0' arguments

How can I fix this?


Solution

  • You probably need to add a constructor that passes something to the base constructor; add:

    class Foo : PlugIn {
        public Foo() : base( //****** here
    }
    

    when you type base(, intellisense should tell you what you need to give the base-constructor.


    edit from searching, you need:

        public Foo (Host host)
            : base(host)
        {
        }