【问题】
C#程序中,有类似这样代码:
// Registers a hot key with Windows. |
编译后出错:
D:\xxx\downloadSongtasteMusic\frmDownloadSonstasteMusic.cs(15,10): error CS0246: The type or namespace name ‘DllImport’ could not be found (are you missing a using directive or an assembly reference?)
【解决过程】
1.参照:C# 小结 二,添加了:
using System.Runtime.InteropServices; |
然后就解决了。
转载请注明:在路上 » 【已解决】error CS0246: The type or namespace name ‘DllImport’ could not be found (are you missing a using directive or an assembly reference?)