我只是想知道,过去几天它正在寻找我是否可以在IIS中托管SignalR Hub?这件事有可能吗?我找到了一个名为"自托管"的解决方案,但它是在控制台应用程序的帮助下完成的.我想在我的IIS中托管SignalR Hub是可能的吗?有人能为我提供一个例子吗?
我要发布自我主机的代码,我想我可能会帮助
class Program
{
static void Main(string[] args)
{
// This will *ONLY* bind to localhost, if you want to bind to all addresses
// use http://*:8080 to bind to all addresses.
// See http://msdn.microsoft.com/en-us/library/system.net.httplistener.aspx
// for more information.
string url = "http://localhost:8080";
using (WebApp.Start(url))
{
Console.WriteLine("Server running on {0}", url);
Console.ReadLine();
}
}
}
class Startup
{
public void Configuration(IAppBuilder app)
{
app.UseCors(CorsOptions.AllowAll);
app.MapSignalR();
}
}
public class MyHub : Hub
{
public void Send(string name, …Run Code Online (Sandbox Code Playgroud)