I have a solution file comprising of 15 projects using a few third party dll references. I want to be able to build the solution from a batch file. What is the best way to do this?
Thanks
When used in a command line, script, or batch file, %1 is used to represent a variable or matched string. For example, in a Microsoft batch file, %1 can print what is entered after the batch file name.
The key to executing a batch file directly in Visual Studio is to Add one using the External Tools selection of the Tools menu. To do this, you: Create a simple batch program that executes other batch programs.
Run msbuild - for example:
msbuild MySolution.sln /p:Configuration=Release /p:Platform="Any CPU"
One of the simplest ways is to execute msbuild with the solution file as input:
@echo off
call %windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe path\to\solution.sln
If this is done in a Visual Studio command prompt you can skip the path to msbuild.exe.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With