Running Windows Forms Application with TeamCity

933 views Asked by At

I need to integrate a Windows Forms Application into TeamCity. The Windows Forms Application can be started by command line too- so by triggering a batch script the application will be started automatically and of course- the GUI will appear.

Now I'm trying to start it with TeamCity- but this doesn't work because by triggering the batch script with TeamCity, the GUI will not appear and the application is not able to fulfil it's purpose. It seems that some GUI elements have to be loaded and that the logical programming code is mixed with the GUI elements.

So my question is: is it possible that TeamCity triggers the application in some way that the GUI will appear- so that it will not run in the background? If not, than I've to seperate the GUI elements from the logical programming code.

Thx a lot in advance!

1

There are 1 answers

0
Twisted Mentat On

If you have TeamCity running as a service then it isn't going to have access to the desktop to run the UI. I've had a similar issue on a previous project trying to run Selenium tests.

To fix this we stopped the TeamCity windows service, logged into the VM with RDP and a valid user account, then started the TeamCity build agent from a shell.

https://confluence.jetbrains.com/display/TCD9/Setting+up+and+Running+Additional+Build+Agents#SettingupandRunningAdditionalBuildAgents-ManualStart

Longer term you'll want to decouple your business logic from the UI as much as you can to make testing easier.