当NancyHost.Start()时NancyFX PlatformNotSupportedException

时间:2017-12-07 12:29:51

标签: c# .net nancy

出于某种原因,我的南希设置停止了工作 这就是我开始南希主持人的方式:

string uriString = @"http://localhost:";
uriString += Port.ToString();
uriString += "/";

try
{
   Console.WriteLine($"Host.Start({uriString})");

   HostConfiguration hostConfigs = new HostConfiguration();
   hostConfigs.UrlReservations.CreateAutomatically = true;

   Uri uri = new Uri(uriString);
   var host = new NancyHost(hostConfigs, uri);
   host.Start();
}
catch (Exception ex)
{
   Console.WriteLine("WWW NOT Started : " + ex);
}

但现在每当我host.Start();时,我都会遇到以下异常:

  

System.PlatformNotSupportedException:不支持操作   这个平台。           在System.Net.HttpListener..ctor()           在Nancy.Hosting.Self.NancyHost.TryStartListener()           在Nancy.Hosting.Self.NancyHost.StartListener()           在Nancy.Hosting.Self.NancyHost.Start()

请帮忙。我参考了Nancy 1.4.4& Nancy.Hosting.Self 1.4.1

0 个答案:

没有答案