IIS 托管工作流服务如何检测应用程序启动和停止
我想挂钩应用程序启动和停止事件来跟踪我的 IIS 托管工作流服务是否正在运行。理想情况下,当我通过启动 AppPool 或 IIS 应用程序(如果多个服务共享同一个 AppPool)来启动工作流服务时,我希望将事件记录到数据库中。当我通过停止 AppPool 或 IIS 应用程序来停止工作流服务时,我想将事件记录到数据库中。
有办法做到这一点吗?
I want to hook into the application start and stop events to track whether my IIS Hosted Workflow Services are running. Ideally, when I start my workflow service via starting the AppPool or the IIS Application (if multiple services share the same AppPool), I want to log an event into a database. And when I stop my workflow service via stopping the AppPool or the IIS Application, I want to log an event into the database.
Is there a way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该查看有关 Windows Server AppFabric 的这篇文章。具体来说,请查看“跟踪的 WF 事件”部分。
http://msdn.microsoft.com/en- us/library/ee677205(v=azure.10).aspx
AppFabric 是单独安装的(http://msdn.microsoft.com/en-us/library/ff637745(v=azure.10).aspx),但我认为这将有助于帮助您实现有关工作流和服务监控的目标。
安装 AppFabric
You should check out this article on Windows Server AppFabric. Specifically, take a look at the section on "Tracked WF Events".
http://msdn.microsoft.com/en-us/library/ee677205(v=azure.10).aspx
AppFabric is a separate install (http://msdn.microsoft.com/en-us/library/ff637745(v=azure.10).aspx), but I think it will go a long way towards helping you accomplish your objectives regarding workflow and service monitoring.
Install AppFabric
我的意见是 Application_Start & Application_End 在应用程序生命周期中执行得太早(或太晚),我认为诸如 DataBase Access 对象之类的东西将不可供您使用。
我的建议是使用文件系统来交换数据。
这会将您想要的任何内容写入文本文件,然后您可以使用简单的服务读取该文件并获取相关数据。
My opinion is that Application_Start & Application_End are executed too early (or too late) during the application life-cycle and I assume that things like DataBase Access object will not be available for you use.
My recommendation is to use FileSystem to exchange the data.
This will write anything you want into a text file, which you can then read with a simple service and fetch the relevant data.