What is the Guid attribute that appears above classes in C#?

后端 未结 3 1485
南笙
南笙 2021-01-17 08:38

I\'ve picked up some C# code recently and one of the classes has a Guid attribute present above it. I don\'t understand what this is or what it\'s used for.

Can some

3条回答
  •  旧时难觅i
    2021-01-17 09:18

    Guid (Globally unique identifier) is used to identify your component by outside world. When you write a project which is going to be used as COM (Component Object Model) you will have to give a unique name. For this reason you need to apply GUID attribute.

    You can read more about it here.

    GUIDAttributeClass

提交回复
热议问题