How to create a batch command file to build your Visual Studio Solution
- Create a batch file ".bat" file under the same directory of your solution and paste the following commands into that file.
net stop w3svc@echo offsetlocalpushd "%~dp0"set MSBUILDEXE=%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exeif not exist "%MSBUILDEXE%" ( echo Microsoft Build Engine ^(MSBuild^) 4.0 does not appear to be echo installed on this machine, which is required to build the echo solution. exit /b 1)for %%i in (debug release) do if exist "%MSBUILDEXE%" "%MSBUILDEXE%" MySolutionNameHere.sln /p:Configuration=%%ipopdnet start w3svc
- Save the file in your solution directory.
- Replace the "MySolutionNameHere.sln" with your solution name.
- Run the batch file