我有一个控制台应用程序,我想用南希主持一个网络服务。这是我的Program.cs
namespace NancyConsole
{
using Nancy.Hosting.Self;
using System;
internal class Program
{
private static void Main(string[] args)
{
string url = "http://localhost:1234";
var host = new NancyHost(new Uri(url));
host.Start();
Console.WriteLine("Server started, now listening on " + url);
Console.WriteLine("Press any key to stop the server...");
Console.ReadKey();
host.Stop();
}
}
}这是我的MainModule.cs文件
namespace NancyConsole
{
using Nancy;
internal class MainModule : NancyModule
{
public MainModule()
{
Get["/"] = x => View["Views/index.html"];
}
}
}这是我的项目结构

当我运行这个项目时,这是我在浏览器上遇到的错误

我不知道我哪里出了问题?您的帮助将不胜感激!
发布于 2017-11-19 10:10:54
https://stackoverflow.com/questions/47375304
复制相似问题