Running an "external program" as a build step

Hello
I'm just getting started with TeamCity, so please bear with me. :)

I (think) I want to run an external program as a build step, but there seems to be a problem with running it through TeamCity. The program works fine when I double click it in Windows.
The program uses a few third-party references that seem to cause the trouble (but as I said, it works fine outside TeamCity).

The program is a console application written in C# in Visual Studio 2010.

I've tried running it as a command with the command line, through Powershell, through MSBuild and as a pre- and post-build step.

The exact thing I want to achieve is updating the software on a simulated embedded device, and then run nUnit tests afterwards. The updating is done through "sending a package" to the simulated device, and this is what my somewhat troublesome program does.

Any tips?

3 comments
Comment actions Permalink

I use PowerShell for that, for example:

Start-Process C:\Programm.exe -ArgumentList "argument1 argument2" -NoNewWindow -Wait
exit 0

0
Comment actions Permalink

Thank you for your reply.

Although this will execute my program, it still doesn't run it as intended (at first glance it seems like it's unable to instantiate objects from the third-party libraries).

0
Comment actions Permalink

In most cases, command line doesn't execute properly, due to misconfiguration. Teamcity reports a command line that it uses to run the program.

You can go to the agent dir and run the same program on behalf of agent user. This usually reveals some issues.

Also, you can see environment variables that were set before execution. You can either print them before build using printenv/set (*nix/Windows) or go to the Paremeters tab on build page. And then use these values to understand why the application doesn't execute as expected.

0

Please sign in to leave a comment.