Chapter 9. Practical Applications, Part 2

In the previous chapter, we started presenting some possible applications of MSBuild that you can use in your own build process. In this chapter, we’ll examine some examples geared towards Web applications. Some of the examples in this chapter include starting and stopping services, encrypting the web.config file, and compressing JavaScript files.

Starting and Stopping Services

There are several instances where either your build or deployment process relies on services to be running. In these cases, you should ensure that the services are installed and started before they are needed. It’s very easy to start and stop services from MSBuild.

You can use the Exec command to execute the command net start or

Get Inside the Microsoft® Build Engine: Using MSBuild and Team Foundation Build, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.