Post build event not working with msbuild.exe

I have a post build event which is writing to a text file. It is working fine when I am building the project from Visual Studio. But when I am using msbuild.exe the Post build event is not writing to the file. I am using msbuild with following parameters:

msbuild.exe TestProj.Web.csproj /p:Configuration=Release /p:OutDir=C:TestProjbin /p:WebProjectOutputDir=C:TestProj /p:DebugSymbols=false /p:DebugType=None

The post build event looks like:

  <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&#xD;&#xA;Created On $(COMPUTERNAME)&#xD;&#xA;Branch is $(BRANCH)&#xD;&#xA;Version Is $(BUILD_NUMBER)" />
  </Target>

我已通过将任务更改为已修复

<WriteLinesToFile File="$(OutDir)VersionInfo.txt" ...... />
链接地址: http://www.djcxy.com/p/69492.html

上一篇: 如何让单个管理员只能访问单一商店产品

下一篇: 发布构建事件不与msbuild.exe一起使用