Oleg Vazhnev
Oleg Vazhnev

Reputation: 24067

SuppressUnmanagedCodeSecurity or SuppressUnmanagedCodeSecurityAttribute?

To disable security checks what should I set? SuppressUnmanagedCodeSecurityAttribute or SuppressUnmanagedCodeSecurity?

Which of these versions is corrrect?

    [DllImport("Native.dll"), SuppressUnmanagedCodeSecurity]
    public static extern void Method(...

or

    [DllImport("Native.dll"), SuppressUnmanagedCodeSecurityAttribute]
    public static extern void Method(...

Upvotes: 1

Views: 1450

Answers (1)

nvoigt
nvoigt

Reputation: 77304

Both do the same thing. The class is named SuppressUnmanagedCodeSecurityAttribute, but when annotating attributes in general, you can omit the suffix Attribute.

Upvotes: 4

Related Questions