惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - NetCobra

近况 让TortoiseSVN使用类似TortoiseCVS的文件冲突解决方式 CSDN双雄——universee(太极语言)和Sinox(汉澳操作系统) The Netron project down, Netron Reloaded... 推荐一个开源项目和一个免费工具 Windows平台下使用Active Directory对Subversion进行权限控制(非完美解决方案) DotNet 项目中链接文件的用处 看看美国的烂公司是怎么样的烂法 SQLite 不能加密? - NetCobra 对软件的多语言化方法的一点看法 最近工作情况 关于 zjsflyer 对 JPgraph 中文显示乱码问题的回复 - NetCobra [旧文]来自 Borcon2003 中国开发者大会的现场报道 每日构建中的两个问题 如何防止 Wiki 被恶意篡改? [翻译] NMock 两分钟教程 [翻译] NMock 简介 头疼的问题:NAnt 的 cvs-checkout 任务无法执行 可以下载 Delphi 2005 试用版了
[问题]DotNet 项目如何实现在构建时 Build 号自动增加?
NetCobra · 2004-11-30 · via 博客园 - NetCobra

继续昨天的问题,今天在Google上找了一下,没有找到很好的方案。

目前找到的解决方案有以下几种:
1.使用一个地三方的 VS.Net 插件,实现在编译时 Build 号自动增加,文章是在 CSDN 上找到的,但是我在 GotDotNet 上没有找到这个插件;
2.使用 VS.Net 的宏,实现在编译时 Build 号自动增加;来源:http://blogs.biasecurities.com/jim/archive/2003/10/08/166.aspx

以上两种方法都要求在 VS.Net 的 IDE 中进行编译,无法用于 NAnt 的自动构建;

3.在 AssemblyInfo.cs 文件中设置[assembly: AssemblyVersion("1.0.*")],编译时“*”会被默认值(???不知道什么默认值,微软文档中说“星号 (*) 表示接受默认的内部版本号、修订号”)代替;
如果这种方法能够成功,那么应该是最理想的;但是这个方法在我这里失败,我试验的时候(非IDE,NAnt脚本构建),这个“*”的确会变,但是变化的毫无规律,上一次 Build 后文件的版本是1.0.1795.37140,再 Build 一次,版本号就变成了 1.0.1795.37192 了,再来一次,版本号是1.0.1795.38763,不知道是怎么变化的。

来源:http://www.devhood.com/messages/message_view-2.aspx?thread_id=99499http://dotnet247.com/247reference/msgs/50/250896.aspx

最不愿意采用的方法就是自己写一个程序,每次编译时读取AssemblyIfo.cs中的VersionNo,自动增加后回写。

总觉得 MS 在设计的时候应该考虑到了这个问题的吧?或许是一个 Unleased 的特性?