I have a post build event that writes to a text file. It works great when I create a project from Visual Studio. But when I use msbuild.exe, the Post build event is not written to the file. I am using msbuild with the following parameters:
msbuild.exe TestProj.Web.csproj /p:Configuration=Release /p:OutDir=C:\TestProj\bin\ /p:WebProjectOutputDir=C:\TestProj\ /p:DebugSymbols=false /p:DebugType=None
The event after the build is as follows:
<PropertyGroup Condition="'$(BUILD_NUMBER)'==''"> <COMPUTERNAME>None</COMPUTERNAME> <BRANCH>None</BRANCH> <BUILD_NUMBER>None</BUILD_NUMBER> </PropertyGroup> <Target Name="AfterBuild"> <WriteLinesToFile File="$(ProjectDir)$(OutputPath)\VersionInfo.txt" Overwrite="true" Lines="Project
Created On $(COMPUTERNAME)
Branch is $(BRANCH)
Version Is $(BUILD_NUMBER)" /> </Target>
Mohammad nadeem
source share