Re: Implementing Interfaces in C#

From: Nick Malik (nickmalik_at_hotmail.nospam.com)
Date: 02/16/04


Date: Mon, 16 Feb 2004 04:36:24 GMT

There have been times when I'm pulling my hair out WISHING C# wouldn't give
me an error when implementing an interface, but no such luck.

Visual C# in the Visual Studio 2003 IDE give me a fatal error if I attempt
to compile an app that does not have all methods of an inherited interface
defined.

Please post an example of what you are seeing. Perhaps we can help you to
find the issue.

--- Nick

"Frank J. Reashore" <reashore@NOSPAMTelus.net> wrote in message
news:OKX6aNC9DHA.3404@TK2MSFTNGP09.phx.gbl...
> Hello Everyone,
>
> I am implementing a simple interface in C# using Visual Studio .net and
was
> quite surprised to discover that the C# compiler does NOT complain if a
> method on the interface is not implemented.
>
> VB.net on the other hand generates a compile error if a method is not
> implemented. This helps in ensuring that all interface methods are
> implemented.
>
> The fact that C# does not provide such compile errors makes implementing
and
> interface in C# more labor intensive than in VB.net. You have to use the
> object browser and check the function signature, etc.
>
> Is this normal behavior? Could I possibly be doing something wrong?
>
> Any help would be appreciated.
>
> Regards,
> Frank J. Reashore
>
> Vancouver, Canada
>
>
>
>
>
>
>



Relevant Pages

  • Re: Anonymous Inner class Creation
    ... > I got an unexpected token compile error. ... Why implement that interface? ... public runmethod for thread entry. ... public void run ...
    (comp.lang.java.programmer)
  • Re: Implementing Interfaces in C#
    ... "Class1 does not implement interface member ABC.DoSomething" ... public interface ABC ... public class Class1: ABC ... > VB.net on the other hand generates a compile error if a method is not ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Implement interface
    ... Tony Johansson wrote: ... > When a class implaments an Interface must the class implement all methods? ... > Will it cause compile error then. ...
    (comp.lang.java)
  • Re: How to "import" an interface into a module w/o `include?
    ... Line 145 contains the attempt to instantiate a perbus_if which is ... an interface defined in the nz_pkg lib. ... This compile error is NOTHING TO DO WITH THAT. ... DOULOS - Developing Design Know-how ...
    (comp.lang.verilog)
  • Re: adsl+sdsl+cable?
    ... Short answer: good luck:) ... Because the outgoing packets will always have the IP ... address associated with the originating interface, ... The server would see the router as the source ...
    (alt.os.linux.suse)