ho il seguente codice:Manca DllImport anche se non c'è un "utilizzando 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);
...
Sto cercando di chiamare la funzione CalcFigure dal exe. L'ho aggiunto nei riferimenti e provando a importarlo. Tutto quello che ottiene è:
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?)
la soluzione più persone a trovare on-line è il "using System.Runtime.InteropServices;" ma ce l'ho
Eh, grazie, lei ha ragione! L'ho preso da una delle risposte su StackOverflow, apparentemente questa persona non era cauta in ciò che scriveva. – Vadiklk