TFS Build无法自动关闭WinForms应用程序 [英] TFS Build can not support the WinForms application shut down automatically

查看:59
本文介绍了TFS Build无法自动关闭WinForms应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

   我有一个用于测试某些特定用例的WinForms应用程序,当测试完成后,应用程序会自动关闭。

   I have a WinForms application for testing some specific use cases, when test finished the application shut down automatically.

它可以很好地手动完成。  我仍然希望将此步骤集成到tfs build。  所以我添加了一个命令行构建步骤来运行应用程序。  

It work well manually.  I still want to integrate this step to tfs build. So I add a command line build step to run the application.  

   我发现应用程序可以复制到构建服务器并运行但是在测试完成后,应用程序无法自动关闭。

   I found the application can be copied to build server and run but when test finished the application can not shut down automatically.

  

  

推荐答案

嗨Joe Cao,

Hi Joe Cao,

感谢您发布此处。

根据我机器上的测试,它在我的机器上运行良好。我使用以下代码创建一个简单的winform应用程序:

According to the test in my machine, it worked well in my machine. I create a simple winform application with the following code:

public Form1()
        {
            InitializeComponent();
            _timer = new Timer();
            _timer.Interval = 5000; // interval in milliseconds here.
            _timer.Tick += (s, e) => this.Close();
            _timer.Start();
        }

使用命令行任务运行exe,窗口将在几秒钟后自动关闭。请确保您的构建代理处于交互模式,请在此处分享您的示例吗?

The use the command line task to run the exe, the window will close automatically after few seconds. Please make sure your build agent is in interactive mode, and could you please share your sample here?

最诚挚的问候

Limitxiao Gao

Limitxiao Gao


这篇关于TFS Build无法自动关闭WinForms应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆