如何在 IIS 6.0 上的 asmx Web 服务中的请求之前调用 Application_Start(在 Global.asax.cs 中)
在我的 ASMX WS 中,当第一个请求到达时,将调用 Application_Start 。那时对我来说有点太晚了。有没有办法在 iisreset 完成后调用它?
在什么是在 asmx Web 服务中为数据库 IO 生成线程的正确方法吗? 我询问了有关预加载系统数据的问题,这些人建议我在 Application_Start 中进行加载。但是,如果仅在第一次请求时完成,则结果是相同的,因此建议根本没有用。
in my ASMX WS Application_Start is called when 1st request arrives. It's kind of too late then for me. Is there any way to get it called when iisreset is done?
In what is the right way to spawn thread for database IO in asmx web service? I asked about preloading system data and the guys advised me to make load in Application_Start. However if it's done only on 1st request, it's the same and thus the advise of no use at all.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您拥有最新的 IIS 7.5,您可能需要查看应用程序初始化 这是最近添加的。我个人没有使用过它,但看起来它可能有你需要的一些东西。
If you have the newest, latest IIS 7.5, you might want to check out the Application Initialization that was just recently added. I personally haven't used it, but it looks like it might have some of the things you need.
您可以创建一个简单的程序来向您的 Web 服务发出虚拟请求。这将第一次触发
Application_Start
。将这个简单的程序作为计划任务运行,在计算机启动时运行。
You can create a simple program to make a dummy request to your web service. This will trigger
Application_Start
the first time.Run this simple program as a scheduled task, running when the computer starts.