Move P/Invokes to NativeMethods class Because it is a P/Invoke method message

前端 未结 2 1631
攒了一身酷
攒了一身酷 2021-01-13 15:51

Can someone suggest what do I have to do with this message?

CA1060 Move P/Invokes to NativeMethods class Because it is a P/Invoke method, \'UCo

2条回答
  •  难免孤独
    2021-01-13 16:41

    Oh!

    I found an answer

    https://msdn.microsoft.com/library/ms182161.aspx

    using System;
    using System.Runtime.InteropServices;
    
        namespace DesignLibrary
        {
        // Violates rule: MovePInvokesToNativeMethodsClass.
            internal class UnmanagedApi
            {
                [DllImport("kernel32.dll")]
                internal static extern bool RemoveDirectory(string name);
            }
        }
    

提交回复
热议问题