1

I have a custom workflow activity that is run in TFS 2010 Build that uses Process and ProcessInfo classes to start a custom .exe that hosts a WCF service for our unit tests.

When the custom .exe is run from my workflow activity that uses Process and ProcessInfo classes to start it nothing works and my unit tests don't pass. But if I start the process directly using a .bat file on the build server all the tests pass fine.

Is there a difference between running a process from the Process class in .Net as opposed to running it directly with a .bat file?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
pgoostree
  • 63
  • 6
  • Could be different environment variables, or different working directories? I don't know much about TFS so it's just a guess. – Samuel Sep 14 '12 at 20:42
  • Who's running the exe? ... I'll let that sink in for a moment. – hollystyles Sep 14 '12 at 20:43
  • When the process is running from TFS build it is running under a service account and that service account is who launches the custom .exe that hosts the WCF Service, but this way does not work. When I log in to the build server directly, I use the same service account to run the .bat file that runs the custom .exe that hosts the WCF service and this works right every time. – pgoostree Sep 14 '12 at 20:51
  • Please add your findings as an answer and accept it. This will close the question. – Artemix Sep 17 '12 at 20:15

1 Answers1

1

I figure out what I had done wrong. When I ran my custom .exe that hosts the WCF service from my .bat file I explicitly did a "cd" to the working dir of the custom .exe. But in my C# custom workflow activity I did not set the working directory on the ProcessInfo type. Once I did that it works perfectly! Thanks for your comments.

pgoostree
  • 63
  • 6