0
我实现了一个简单的WorkItemChangedEventHandler的TFS 2015年TFS服务器端插件启动两次
在我的TFS 2015年快速测试安装,事件处理程序获取实例化两次。第一个实例是在TFS识别出由于新构建而导致的BinDirChangeOrDirectoryRename后立即创建的。第二个实例是在第一次访问数据库之后创建的。
鉴于此源代码(注意,只有构造函数相关的):
我碰到下面的事件记录:
Information 09.03.2017 17:37:16 TFS Services 9002 None The application is being shutdown for the following reason: BinDirChangeOrDirectoryRename
Information 09.03.2017 17:37:23 TFS Services 0 None New Plugin Instance Created with Hash 44661510
Information 09.03.2017 17:37:24 TFS Services 9001 None Application Request Processing Started
Information 09.03.2017 17:37:58 MSSQL$SQLEXPRESS 17137 Server Starting up database 'Tfs_DefaultCollection'.
Information 09.03.2017 17:37:58 TFS Services 0 None New Plugin Instance Created with Hash 27996961
难道这在TFS 2015年或错误我想念什么?
当一个事件来通过调用两次你的代码? –
事件只发射一次。感谢提示。但是,我必须重新设计我的事件处理程序,因为它需要创建后台线程来触发延迟更新过程。没有必要同时运行两个这样的线程。 – freefall
为什么不把它作为服务钩子而不是服务器端插件来实现? –