Missing DLLImport even though there is a “using InteropServices” December 29, 2023 by Tarik Try adding using System.Runtime.InteropServices; to your class, that’s the namespace the DllImportAttribute resides in.