이 경우에도 같이 DllImport를 누락 나는 다음과 같은 코드를 가지고 : 나는 .EXE에서 CalcFigure 함수를 호출하는 것을 시도하고있다는 "사용 InteropServices"
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MapsApp.DB;
namespace MapsApp
{
public partial class _Default : System.Web.UI.Page
{
[DLLImport("GeoUrbanApp.exe")]
public static extern double CalcFigure(double east, double north, double size);
...
합니다. 참조에 추가하고 가져 오기를 시도했습니다. 내가 얻는 것은 :
The type or namespace name 'DLLImport' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'DLLImportAttribute' could not be found (are you missing a using directive or an assembly reference?)
대부분의 사람들이 온라인에서 찾을 수있는 해결책은 "using System.Runtime.InteropServices;"입니다. 하지만 나는 그것을 가지고있다. "System.Runtime.InteropServices를 사용하여;"
ㅎ 감사합니다, 당신이 올바른지! 나는 stackoverflow에 대한 답변 중 하나에서 그것을 가져, 분명히이 사람은 그가 쓴 것을 신중하지 않았다. – Vadiklk