需要在 Visual Studio 运行时发送电子邮件通知
我正在使用 Visual Studio 2005 执行一个测试执行项目(使用 pnunit 框架和 C#,但它不相关)。总执行时间超过40小时。在此期间,如果网络上存在任何环境问题(外部因素,如远程服务器关闭、数据库关闭等),代码将停止执行。这会产生一个问题,因为当我注意到错误时,我必须手动正确设置外部因素并再次恢复运行。因此,经常检查执行进度变得很重要,以确保我们不会因为执行停止而浪费时间,这很麻烦。
我正在寻找一种方法,以某种方式在代码停止运行时触发电子邮件/批处理脚本/exe/任何内容。我有什么办法可以实现这个目标吗?有什么想法吗?
谢谢, 无限
I'm executing a test-execution project using visual studio 2005 (using the pnunit framework and C# but its not relevant). The total execution time is more than 40 hours. In between if there are any environment problems on the network (external factors like remote server is down, db is down etc) the code stops executing. This creates a problem because when I notice the error I'll have to manually set external factors right and again resume the run. So it becomes important to keep checking the execution progress frequently to make sure we are not losing time due to halted execution, which is troublesome.
I looking for a way to somehow either triggering an email/batch script/exe/anything when the code stops running. Is there any way I could achieve this? Any ideas?
Thanks,
Mugen
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您只需要在申请结束时触发电子邮件,那么我建议将代码放在这里 在执行结束时。
If you only need to trigger an email at the end of the application, then I would suggest putting the code here at the end of your execution.