Search This Blog

Tuesday, February 25, 2014

c# GuidAttribute Example

C# > InteropServices >  GuidAttribute 

Supplies an explicit Guid when an automatic GUID is undesirable.

When you write an application to be used as COM you have 
to give a unique name. In this case you need to apply GUID attribute.

Example

Class that is exported to COM with a fixed GUID


[GuidAttribute("bd2d60fa-8e40-4d06-ad6f-8760983efe33")]
public class ExposedToComClass
{
          
}