Commandline build script for .NET project

Dec 22 2004 9:34 AM
Hi Guys .... I am developing an ASP.NET application with C# using Visual Studio .NET 2003. I have a single solution which contains individual projects for the Data layer, Data Access layer, Manager layer, Utility layer, the web application itself, the setup project(for installer) and a couple of other helper projects. I created the project as a blank solution file and went on adding the individual projects. Now I have delivered my client with the full source code and he can open the solution and compile the full project. But what he wants is a commandline script(possibly a .BAT file) which when invoked from the command line prompt will compile all the projects and place all the assemblies(component dlls) to the appropriate folder(under the bin subfolder of the web application folder). So essentially what he is looking for is to have a single .BAT file which will do all the compiling and building task that I am doing through the IDE. Now I am relatively new to .NET and I really have no idea of how this can be achieved. I know that individual .NET projects can be compiled from the command line using the command line version of C# compiler(I have never tried it though). But in my case, since the solution file contains other projects, they have dependencies on each other. For example my Data Access layer depends on the Data layer(refernces the Data layer dll), the Utility layer depends on both the Data layer and the Data Access Layer and so on for the other projects, the maximum number of dependencies being for the web application project. So there has to be a proper build order for the projects. The projects should be build in the ascending order of dependencies, the project with no dependency being built first. I can specify the build order for the projects in VS .NET IDE but I have no idea of how this can be done through a command line script file. Can anyone help me with this. Any URL which discusses this issue or sample code will be extremely helpful. I am a little pressed on time here. Need some help as sson as possible. Thanks folks.

Answers (1)