class MyClass { static void Main() { Type type = typeof(MyClass); Type definition = type.GetTypeDefinition(); Console.WriteLine(definition.FullName); } }
class Program { static void Main(string[] args) { Type type = typeof(int); Type definition = type.GetTypeDefinition(); Console.WriteLine(definition.FullName); } }This example retrieves the TypeDef for the int type and prints out its fully qualified name. Package/library: This example uses the Microsoft.VisualBasic.CompilerServices namespace.