【发布时间】:2013-11-25 21:20:33
【问题描述】:
我正在尝试在我的自动化测试构建 - MSBuild .proj 中修改 AssemblyInfo.cs 中的版本号。我可以成功地将任何我想写到 AssemblyInfo.cs 中,但这并没有反映在 bin 或 bin/Project/_PublishedWebsites/bin 中的项目 DLL 中。
我曾尝试在我的 msbuild .proj 中使用 InitialTargets、BeforeBuild 和 BeforeCompile,但这会修改 src/.../Properties/ AssemblyInfo.cs 它似乎并没有最终进入编译 DLL。
我尝试过的一些例子:
<Project ToolsVersion="4.0" InitialTargets="BeforeCompile" DefaultTargets="FullPublish" ...
和/或
<Target Name="BeforeCompile"
更全面的情况是我想做以下事情:
- 将 AssemblyInfo 修改为 TFS 构建版本/修订版
- 构建/编译 sln
- 转换 web.config
- 调用节点r.js
- 部署到我们的负载平衡服务器
就我个人而言,它们都运行良好,我只是缺少具有正确版本号的编译 project.dll - 它总是显示 1.0.0.0。我想要 1) 在项目建成之前和 3-5 之后。
如果有任何相关性,我正在使用 MSBuild.Community.Tasks.Targets 和 Microsoft.Web.Publishing.Tasks.dll。
【问题讨论】:
标签: msbuild