내 컴파일러에서 kernel32.dll을 가져올 수 없다는 문제가 있습니다. 필자는 System.Runtime.InteropServices를 사용하고 있습니다. 여기에 코드입니다 : ". 현재 컨텍스트에서"컨텍스트에서 C# DllImport가 발견되지 않지만 Interpor Services가 바인딩됩니다.
using System;
...
using System.Runtime.InteropServices;
namespace server
{
class Debugconsole
{
public void Initialise()
{
[DllImport("kernel32.dll")]
...
}
}
}
그것은 syntaxerrors의 전체 무리를 던져 같이 DllImport "를 찾을 수 없습니다"는
도움 주셔서 감사합니다.
당신은 그것이 외부에 배치해야하는 방법, 내부의'DllImport'을 잘못했습니다. [이 답변] (http://stackoverflow.com/questions/6076717/where-to-put-dllimport)을 확인하십시오. – Vlad