System.Runtime.InteropServices.DefaultCharSetAttribute Class

Specifies the value of the System.Runtime.InteropServices.CharSet enumeration. This class cannot be inherited.

See Also: DefaultCharSetAttribute Members


[System.AttributeUsage(System.AttributeTargets.Module, Inherited=false)]
public sealed class DefaultCharSetAttribute : Attribute


Apply the System.Runtime.InteropServices.DefaultCharSetAttribute attribute at the assembly level or module level to set the DllImportAttribute.CharSet value for any call to System.Runtime.InteropServices.DllImportAttribute that does not include a DllImportAttribute.CharSet named argument specified by the user.

A DllImportAttribute.CharSet named argument specified by the user overrides the setting of System.Runtime.InteropServices.DefaultCharSetAttribute.


Only the C# and Visual Basic compilers recognize this attribute; it is not used by the C++ compiler.


Namespace: System.Runtime.InteropServices
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions:,
Since: .NET 2.0