我们有一个基于批处理的构建过程,并且我们只使用MSBuild来编译来自visual studio的项目文件。我们还将wix集成到我们的构建过程中。为了设置我们在main-build-script中指定的软件版本,需要在构建过程中使用一些环境变量。我的问题是,我必须在我的程序集信息中设置程序集的FileVersion (AssemblyFileVersion)。有没有办法给MSBuild-call一个带有要设置的版本的属性?如下所示(这不起作用):
%dotnetdir%msbuild.exe Viewer.csproj /property:Configuration=Release /property:Platform=AnyCPU /property:AssemblyFileVersion=%major%.%minor%.%build%生成的程序集应该具有文件版本%major%.%minor%.%build%。在所有项目中设置AssemblyFileVersion-setting对我来说很痛苦。这样做的程序违背了我的哲学(我不想通过自动化过程改变我的源代码)。应该通过build-script设置版本。不需要在AssemblyInfo.cs中设置AssemblyFileVersion
或者,是否有可能使用MSBuild指定一个描述程序集信息的xml配置文件?
如果有任何建议,那就太好了。
问候,谢谢,马丁
发布于 2009-12-07 19:51:45
MSBuild Community Tasks项目中的Version和AssemblyInfo任务可能会有所帮助。
https://stackoverflow.com/questions/1859328
复制相似问题