项目发布到IIS,Global.asax中不执行
在vs中调试,能执行Application_Start() 方法并执行 PollingApproval.StartTask();
发布到IIS,一点动静都没有,感觉没调用
Global.asax 类中:
protected void Application_Start()
{
//log4net.Config.XmlConfigurator.Configure(new System.IO.FileInfo(Server.MapPath("~/Web.config")));
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
PollingApproval.StartTask();
}
PollingApproval 类:
public static void StartTask()
{
lock (objlock)
{
int Interval = ConfigurationParameter.intervalSeconds;
timer = new System.Timers.Timer();
timer.Elapsed += new System.Timers.ElapsedEventHandler(SendApvMessage);
timer.Interval = Interval;
timer.Enabled = true;
timer.Start();
}
}
发布到IIS,一点动静都没有,感觉没调用
Global.asax 类中:
protected void Application_Start()
{
//log4net.Config.XmlConfigurator.Configure(new System.IO.FileInfo(Server.MapPath("~/Web.config")));
AreaRegistration.RegisterAllAreas();
GlobalConfiguration.Configure(WebApiConfig.Register);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
PollingApproval.StartTask();
}
PollingApproval 类:
public static void StartTask()
{
lock (objlock)
{
int Interval = ConfigurationParameter.intervalSeconds;
timer = new System.Timers.Timer();
timer.Elapsed += new System.Timers.ElapsedEventHandler(SendApvMessage);
timer.Interval = Interval;
timer.Enabled = true;
timer.Start();
}
}
...全文
相关推荐
RestDemo.zip
Asp.net实现Rest服务,环境 IDE:VS2013 实现思路 Rest接口实现了CRUD四种常见的数据操作,支持数据返回格式为json,Stream等。在.NET环境中实现该功能.
ASP,NET MVC自学手册
ASP.NET MVC自学手册
ASP,NET源码——[新闻文章]我的小书坊源码(三层实现).zip
ASP,NET源码——[新闻文章]我的小书坊源码(三层实现).zip
win10下 VS2019 C#创建web项目并发布部署在iis
win10下 VS2019 C#创建web项目并发布部署在iis
Global.asax的Application_Error实现错误记录/错误日志的代码
本文为大家介绍下利用Global.asax的Application_Error实现错误记录,具体如下,有此需求的朋友可以参考下,希望对大家有所帮助



