【问题标题】:Setting AssemblyFileVersion with MSBuild-call?使用 MSBuild 调用设置 AssemblyFileVersion?
【发布时间】:2010-12-23 23:29:41
【问题描述】:

我们有一个基于批处理的构建过程,我们使用 MSBuild 仅用于从 Visual Studio 编译我们的项目文件。我们还将 wix 集成到我们的构建过程中。为了设置我们软件的版本,我们在 main-build-script 中指定了一些在构建过程中使用的环境变量。 我的问题是,我必须在我的程序集信息中设置程序集的文件版本(AssemblyFileVersion)。 有没有办法给 MSBuild-call 一个带有要设置的版本的属性?像这样(这不起作用):

%dotnetdir%msbuild.exe Viewer.csproj /property:Configuration=Release /property:Platform=AnyCPU /property:AssemblyFileVersion=%major%.%minor%.%build%

生成的程序集应具有文件版本%major%.%minor%.%build%。 在所有项目中设置 AssemblyFileVersion 设置对我来说很痛苦。这样做的程序违背了我的理念(我不想用自动化流程改变我的来源)。版本应通过构建脚本设置。不必在 AssemblyInfo.cs 中设置 AssemblyFileVersion

或者 MSBuild 是否有可能指定一个描述程序集信息的 xml 配置文件?

如果有什么建议就好了。

您好,谢谢, 马丁

【问题讨论】:

    标签: msbuild build-process automation versioning assemblyinfo


    【解决方案1】:

    MSBuild Community Tasks 项目中的 VersionAssemblyInfo 任务可能会有所帮助。

    【讨论】:

    • 这方面的任何例子吗?在 .wdproj 上尝试过,引用的程序集没有更新版本。
    猜你喜欢
    • 1970-01-01
    • 2011-10-03
    • 2010-10-16
    • 2013-11-03
    • 1970-01-01
    • 2012-01-22
    • 2012-12-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多