I am trying to decide which side I am participating in the MsBuild war against Nant. I start with: stop the service, deploy some files, restart the service. Just by looking at these two links, it's much easier to do in Nantes.
MSBuild: Service Usage Example Is there an MSBuild task in Microsoft.Sdc.Tasks?
<target name="service_exists"> <script language="C#"> <references> <include name="System.ServiceProcess.dll" /> </references> <code><![CDATA[ public static void ScriptMain(Project project) { String serviceName = project.Properties["service.name"]; project.Properties["service.exists"] = "false"; project.Properties["service.running"] = "false"; System.ServiceProcess.ServiceController[] scServices; scServices = System.ServiceProcess.ServiceController.GetServices(); foreach (System.ServiceProcess.ServiceController scTemp in scServices) { etc...
Nantes: http://ryepup.unwashedmeme.com/blog/2007/01/04/restart-a-windows-service-remotely/
<exec program="sc.exe"> <arg line="\\server stop shibd_Default"/> </exec> <sleep seconds="5"/> <exec program="sc.exe"> <arg line="\\server start shibd_Default"/> </exec>
I wonder if the SO community agrees with me. Is it easier to get basic things like this in Nantes? Of course it looks like this. C # code in a CDATA block? WTF?
Our current build process: a) many bat files, b) many curses. I would love to find a good replacement, but the MsBuild material looks like a world of pain in front of my eyes. I think you need to build scripts in Nant, and then use MsBuild to execute any .NET assemblies that need to be executed.
One important question : which one is better to catch errors in the script before running the script? I thought about rolling on my own, and it was very important: compile all your data and make sure that it makes sense before trying to run.
source share