Why interfaces in C# don't have a GUID ?

Bill Johnson 11 Reputation points
2023-07-01T23:11:56.05+00:00

Hi,

Interfaces in Delphi have GUIDs ?

e.g.

type

ISingletonF = interface ['{5182E010-121F-4CD9-85EB-4F31D34354F2}']

procedure Log(logTarget: TListBox; const msg: string);

end;

Why interfaces in C# don't have interfaces ?

Also, are interfaces in C# reference counted ?

TIA

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,205 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 69,426 Reputation points
    2023-07-02T16:10:51.6766667+00:00

    Interfaces in C# are built into the language and have a unique name, so a guid is not required. If c# exposes a com interface, then there is a guid.

    in c# an interface is abstract type, meaning you can not create an instance of one. A concrete class must implement an interface and a class instance can be cast to any interface it implements.

    c# uses a mark and sweep garbage collector instead of reference counts.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.