kasdoffe Posted March 18, 2004 Posted March 18, 2004 I have a large C# project w/ multiple dll's referenced that I've created in MS Vis Studio 2003. It creates a Windows Application. Is it possible to compile the entire project command line and produce the same output as if I compiled it through studio? I've asked this question before, but received no answer.. :( I know about csc.exe already, just can't figure out how to use it to compile the same. I don't like having to specify everything, like references, output type, etc. When i heard that c# had a command line compiler I just figured i could switch to the project directory via command line and csc.exe the .sln file and voila, output. :) Any response is appreciated. Quote
Jaco Posted March 19, 2004 Posted March 19, 2004 I have a batch file: cd C:\Program Files\Microsoft Visual Studio .NET\Common7\IDE devenv /build release C:\My Solution Dir\My Solution.sln This is the easiest way I've found (I actually execute the batch file from my "builder" program and set various preprocesser flags there also). Quote
kasdoffe Posted March 19, 2004 Author Posted March 19, 2004 Sweet! That works perfectly. Thanks for your response. Quote
kasdoffe Posted March 19, 2004 Author Posted March 19, 2004 I have a batch file: cd C:\Program Files\Microsoft Visual Studio .NET\Common7\IDE devenv /build release C:\My Solution Dir\My Solution.sln This is the easiest way I've found (I actually execute the batch file from my "builder" program and set various preprocesser flags there also). Wait! Can this be accomplished with someone who doesn't have studio installed? Instead, they would only have the framework or SDK or whatever the free stuff is. Quote
mocella Posted March 19, 2004 Posted March 19, 2004 I've got my builds automated using Nant, thereby using the C# command-line compiler in this sort of fashion. It's a damn nice utility - I have 5 projects in my solution and Nant fires through everything, runs my unit-tests (NDoc) and creates a .chm file (NDoc) at the end. Best of all, these utilities I use are all open-source/free. Wait! Can this be accomplished with someone who doesn't have studio installed? Instead' date=' they would only have the framework or SDK or whatever the free stuff is.[/quote'] Quote
Jaco Posted March 19, 2004 Posted March 19, 2004 Wait! Can this be accomplished with someone who doesn't have studio installed? Instead' date=' they would only have the framework or SDK or whatever the free stuff is.[/quote'] No, you need studio installed. Actually, the call to "devenv" is a call to the VS IDE to compile without actually showing the IDE. It's just so much easier than the true command line compiler (still don't know how you would compile a solution in that). Quote
mocella Posted March 19, 2004 Posted March 19, 2004 Right, but you only need the SDK to run Nant, which is a bit more work than calling "devenv", but a heck of a lot more flexible in the longrun. Quote
*Gurus* Derek Stone Posted March 19, 2004 *Gurus* Posted March 19, 2004 You can use either the C# compiler (csc.exe) or the Visual Basic .NET compiler (vbc.exe) without having Visual Studio .NET installed. The two compilers, along with numerous other tools, are available in the .NET Framework SDK. Quote Posting Guidelines
mocella Posted March 19, 2004 Posted March 19, 2004 Right - I should have mentioned that - Nant just hooks into other utilities you have installed through the Framework SDK and any other (NDoc, NUnit, etc). Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.