SuppressUnmanagedCodeSecurity或SuppressUnmanagedCodeSecurityAttribute?

时间:2013-05-15 09:21:40

标签: c#

要禁用安全检查,我应该设置什么? SuppressUnmanagedCodeSecurityAttributeSuppressUnmanagedCodeSecurity

哪些版本是正确的?

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

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

1 个答案:

答案 0 :(得分:4)

两者都做同样的事情。该类名为SuppressUnmanagedCodeSecurityAttribute,但在一般注释属性时,可以省略后缀Attribute