[Mono-list] about guid

Robert Jordan robertj at gmx.net
Sun Aug 15 10:20:06 EDT 2010

On 15.08.2010 14:30, Feng Su wrote:
> I compile a file to a assembly. I find the Guids of all classes  is
> 00000000-0000-0000-0000-000000000000.
> How can generate the different Guids for these classes?

You can manually apply a GuidAttribute to these classes, something
like that:

using System;
using System.Runtime.InteropServices;

class Program
	static void Main ()
		Console.WriteLine (typeof(Program).GUID);

Automatic Type.GUIDs are not implemented in Mono, mostly
because the algorithms behind MS' implementation are not well


More information about the Mono-list mailing list