【发布时间】:2018-03-10 00:42:12
【问题描述】:
问题
如何从 AssemblyInfo.cs 文件中读取版本并在 TeamCity 中将其设置为 %build.number%?
更多信息
基本上我想在这个例子中阅读版本(2.2.0):
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("97f3f431-69a7-48c2-8bf8-7ae29075b72e")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.2.0")]
[assembly: AssemblyFileVersion("2.2.0")]
[assembly: NeutralResourcesLanguage("en-US")]
并将其用作我在 TeamCity 项目中的%build.number%
【问题讨论】:
-
不是我,但我的猜测是缺乏任何研究的证据。我把这个问题放到谷歌上,得到了很多点击 - 为什么这些都不适合你?
-
@CharlesMager 大部分资源在线,展示了如何替换 AssemblyInfo 版本。我需要阅读此版本并将其设置为 teamcity 中预定义的 %build.number% 变量。
-
@CharlesMager 谢谢你回答了我的问题。
标签: c# .net teamcity teamcity-9.0 assemblyinfo