Marshal.GenerateProgIdForType(Type) Method

Definition

Returns a programmatic identifier (ProgID) for the specified type.

C#
public static string? GenerateProgIdForType(Type type);
C#
public static string GenerateProgIdForType(Type type);
C#
[System.Security.SecurityCritical]
public static string GenerateProgIdForType(Type type);

Parameters

type
Type

The type to get a ProgID for.

Returns

The ProgID of the specified type.

Attributes

Exceptions

The type parameter is not a class that can be create by COM. The class must be public, have a public parameterless constructor, and be COM visible.

The type parameter is null.

Remarks

If the type has a ProgID in the metadata, that ProgID is returned. Otherwise, a ProgID is generated based on the fully qualified name of the type.

Applies to

Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.1