How To: Specify Long Command Lines to MSBuild
Sometimes when using MSBuild.exe the command lines can get pretty darn long and hard to manage. This is particularly true if you're using a custom logger that takes parameters. I also ran into some trouble when I was trying to pass an escaped string to the custom logger via the Visual Studio UI for project properties (the string was getting automatically unescaped by VS. Remind you of a recent blog entry?). The answer to both these problems is to use a response file for the command line parameters.
Response files are super easy. Just create a text file using your favourite text editor and put all your command line parameters in it. Then when you run MSBuild use the following command:
msbuild @parameters.txt
Then MSBuild will read all the command line parameters from the text file, and proceed as usual.
[ Author: Neil Enns ]
Comments
Anonymous
November 29, 2005
Can I put the parameters into multiple lines for better readability in the response file?Anonymous
November 29, 2005
Yes, you can use multiple lines. You can even include comments.
See: http://blogs.msdn.com/csharpfaq/archive/2004/10/20/245238.aspxAnonymous
November 29, 2005
I sent that too soon. If you look in your .NET FX install directory (c:WINDOWSMicrosoft.NETFrameworkv2.0.50727, for example) you can find a few examples of response files: csc.rsp, MSBuild.rsp, vbc.rsp.Anonymous
June 06, 2006
Thanks!!! http://www.insurance-top.com/company/">http://www.insurance-top.com/company/ auto site insurance. [URL=http://www.insurance-top.com]home insurance[/URL]: The autos insurance company, compare car insurance, auto insurance. Also [url=http://www.insurance-top.com]cars insurance[/url] from website .Anonymous
June 06, 2006
Hi! http://www.insurance-top.com/company/ auto site insurance. The autos insurance company, compare car insurance, auto insurance. from website .Anonymous
June 06, 2006
ringtones freeAnonymous
April 09, 2007
The comment has been removedAnonymous
May 29, 2009
PingBack from http://paidsurveyshub.info/story.php?title=msbuild-team-blog-how-to-specify-long-command-lines-to-msbuildAnonymous
June 09, 2009
PingBack from http://weakbladder.info/story.php?id=5337Anonymous
June 17, 2009
PingBack from http://patioumbrellasource.info/story.php?id=1311