C # version with MSBuild (enter the code below into the .bat file)
set msBuildDir=%WINDIR%\Microsoft.NET\Framework\v4.0.30319 set msBuildDir=%WINDIR%\Microsoft.NET\Framework\v2.0.50727 call %msBuildDir%\msbuild ".\SomeFolder\MyCSharpProject.csproj" /p:Configuration=Release /l:FileLogger,Microsoft.Build.Engine;logfile=Manual_MSBuild_ReleaseVersion_One_Project_CSharp_LOG.log set msBuildDir=
Or for C ++:
set msBuildDir=%WINDIR%\Microsoft.NET\Framework\v2.0.50727 set msBuildDir=%WINDIR%\Microsoft.NET\Framework\v4.0.30319 call %msBuildDir%\msbuild ".\Project1\Project1\Project1.vcxproj" /p:Configuration=Release /l:FileLogger,Microsoft.Build.Engine;logfile=Manual_MSBuild_ReleaseVersion_One_Project_C_Plus_Plus_LOG.log set msBuildDir=
You will need to select a framework (2.0 or 4.0 (or another), where I have
set msBuildDir=%WINDIR%\Microsoft.NET\Framework\vA.BCDEF
Just comment out or delete the version of the framework you don't want.
I had a solution with five (sub) projects. I built the "lowest" project. And he just built this (single) assembly.
Keep in mind that if the project you choose has dependencies, it will also build them. AKA, if you choose the "largest" assembly, it will build everything it needs.
source share