Create a .bat file called: Manual_MSBuild_ReleaseVersion.bat
Put this in a .bat file.
REM set msBuildDir=%WINDIR%\Microsoft.NET\Framework\v3.5 set msBuildDir=%WINDIR%\Microsoft.NET\Framework\v4.0.30319 call %msBuildDir%\msbuild.exe MySolution.sln /p:Configuration=Release /l:FileLogger,Microsoft.Build.Engine;logfile=Manual_MSBuild_ReleaseVersion_LOG.log set msBuildDir=
You can create a .sln file or a .csproj file. MySolution.sln or MyProject.csproj
See How to Use MSBuild to Build a Web Package for more information.
You can do it one more step:
rd .\BuildResults /S /Q md .\BuildResults rd .\MyProject\Bin\Release /S /Q REM set msBuildDir=%WINDIR%\Microsoft.NET\Framework\v3.5 set msBuildDir=%WINDIR%\Microsoft.NET\Framework\v4.0.30319 call %msBuildDir%\msbuild.exe MySolution.sln /p:Configuration=Release /l:FileLogger,Microsoft.Build.Engine;logfile=Manual_MSBuild_ReleaseVersion_LOG.log set msBuildDir= XCOPY .\MyProject\Bin\Release\*.* .\BuildResults\
This way you delete the directory (just make sure you get a super clean assembly), create it, create a solution / project and copy the assembly results to a new directory.
Super fresh every time. And if the assembly explodes, the \ BuildResults directory is empty.
And a thin little indicator, the \ BuildResults catalog datetime is the last time you built (or tried to build) a solution / project. Thin, but sometimes useful.
granadaCoder Apr 14 2018-11-21T00: 00Z
source share