У меня есть полнофункциональное приложение ASP.NET MVC (состоящее из 5 сборок,.NET 4.5.1, ASP.NET MVC 5.2.2), которое отлично работает в Visual Studio (которое использует IISExpress).
Теперь я хотел бы иметь консольное приложение, которое принимает приложение MVC и размещает его (собственный хостинг).
Я пробовал с Microsoft.Owin.Host.HttpListener
и Nancy.Owin
, но пока я получаю 404 страницы, в моих конфигурациях отсутствует сопоставление с моим MVC-приложением.
Я получил
public class Startup
{
public void Configuration(IAppBuilder app)
{
app.UseNancy();
}
}
и
static void Main(string[] args)
{
StartOptions so = new StartOptions("http://localhost:9000/");
using (WebApp.Start<Startup>(so))
{
Console.WriteLine("Press Enter to Exit");
Console.ReadLine();
}
}
Но, очевидно, отсутствует конфигурация для использования MyMvcApplication
из запущенного приложения MVC. Как это сделать? Или как сделать это в противном случае?
Ответы, которые я нашел в Интернете, относятся к более старым версиям, и я надеялся, что сегодня будет более простой способ.