Pass a parameter to OWIN host

前端 未结 2 824
遥遥无期
遥遥无期 2021-02-20 08:04

I\'m self-hosting ASP.NET Web API and SignalR using OWIN. I start the server (on a console app) with this code:

using (WebApplication.Start(url))
         


        
2条回答
  •  时光说笑
    2021-02-20 08:46

    You can use the WebApp.Start Method (String, Action) overload.

    Example:

    using (WebApplication.Start(url, appBuilder => new Startup(myObject).Configuration(appBuilder)))
    {
        Console.WriteLine("Running...");
        Console.ReadLine();
    }
    

提交回复
热议问题