How to start Team Foundation Build Service using Tfs API
-
19 iunie 2012 09:43
Hi,
I have been striving hard to start The Team Foundation Build Service using the tfs api. The below code line runs the build service as Interactive process but I want to run it as a Windows Service
typeof(BuildServiceHostUtilities).Assembly.GetType("Microsoft.TeamFoundation.Build.Config.BuildServiceHostProcess").InvokeMember("Start", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.InvokeMethod | System.Reflection.BindingFlags.Static, null, null, new object[] { true, null });
Looking forward to hearing from you all soon. Thanks beforehand.
-Noor
Toate mesajele
-
19 iunie 2012 10:46
Hi Noor,
The build service is running as a windows service, called "Visual Studio Team Foundation Build Service Host" (service name: TFSBuildServiceHost). So I would not use the API, but something like described here: http://social.msdn.microsoft.com/Forums/en/netfxremoting/thread/bdbfd945-3941-4217-bb03-3e15375b80d9 .
Cheers, Fokko
ALM/TFS Consultant, Software Developer C#.NET, SQL Server specialist at Delta-N BV (http://www.delta-n.nl)
-
19 iunie 2012 10:59
If its just a windows service can't you do this?
var sc = new System.ServiceProcess.ServiceController("MyService", "MyRemoteMachine"); sc.Start(); sc.WaitForStatus(System.ServiceProcess.ServiceControllerStatus.Running); sc.Stop(); sc.WaitForStatus(System.ServiceProcess.ServiceControllerStatus.Stopped);replace the "MyService" with the name of the service you intend to control and "MyRemoteMachine" with the name of the machine where this service sits.
Please remember to mark the replies as answers if they help.
Blog: http://geekswithblogs.net/TarunArora
Subscribe in a reader- Marcat ca răspuns de noor syed 20 iunie 2012 06:34
