ciao!
stavo cercando di seguire questo tutorial: https://docs.microsoft.com/en-us/asp...host-a-web-api
ma in pratica a me non funziona, in quanto mi da questo errore:
codice:
Eccezione generata: 'System.AggregateException' in mscorlib.dll
Il programma '[1972] TestSelfHosted.exe' è terminato con il codice 0 (0x0).
questo il codice:
codice:
using System;
using System.Web.Http;
using System.Web.Http.SelfHost;
namespace TestSelfHosted
{
class Program
{
static void Main(string[] args)
{
try
{
var config = new HttpSelfHostConfiguration("http://localhost:8888");
config.Routes.MapHttpRoute(
"API Default", "api/{controller}/{id}",
new { id = RouteParameter.Optional }
);
using (HttpSelfHostServer server = new HttpSelfHostServer(config))
{
server.OpenAsync().Wait();
Console.WriteLine("Press Enter to quit.");
Console.ReadLine();
}
}
catch (AggregateException ex)
{
Console.WriteLine("ERRORE: " + ex.Message);
}
}
}
}
ho provato banalmente con il try/catch per avere qualche dettaglio sull'errore, ma senza risultati.
ho provato a dare uno sguardo in giro, ma non ci ho capito granchè.
qualcuno ha qualche idea??