我使用ServiceStack进行自我主机(AppSelfHostBase),我需要使用hangfire仪表板。我在项目中添加了Owin Startup类,但是当我运行它时,没有显示任何内容。
private static Logger Logger = LogManager.GetCurrentClassLogger();
private AppHost _serviceStackHost;
private HostControl _hostControl;
public JobWinService()
{
//Nothing should be added here
_serviceStackHost = null;
_hostControl = null;
}
bool ServiceControl.Start(HostControl hostControl)
{
_hostControl = hostControl;
Logger.Info("--------> U-Bet Job Service starting <--------");
try
{
if (_serviceStackHost == null)
{
var listeningOn = "http://*:" + Properties.Settings.Default.ServicePort + "/";
_serviceStackHost = new AppHost();
_serviceStackHost.Init();
_serviceStackHost.Start(listeningOn);
}
}
catch (Exception ex)
{
Logger.Warn(ex, "Exception occured:{0}", ex.Message);
return false;
}
Logger.Info("--------> U-Bet Job Service started <--------");
return true;
}