为什么不检查 AssemblyInfo.cs
我正在看 Git 上的视频,那家伙特意忽略了 AssemblyInfo.cs。为什么我不应该签入该文件?如果我不签入文件,当下一个用户签出我的代码时,Visual Studio 不会抱怨吗?
I was watching a video on Git and the guy went out of his way to ignore the AssemblyInfo.cs. Why should I not check that file in? If I don't check the file in won't Visual Studio complain for the next user when he checks my code out?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有些人在构建时从脚本生成 AssemblyInfo.cs。这样日期和版本号就可以自动更改。
Some people generate AssemblyInfo.cs from a script when building. That way the date and version numbers can be changed automatically.
我能想到的主要缺点是 AssemblyInfo.cs 是构建的程序集的各种版本号的来源。
这并不意味着您的 AssemblyInfo.cs 文件不应该处于源代码管理中(我认为它们绝对应该如此),而是开发人员在签入它们时应该非常小心。
在我工作的地方,我们有一个管理版本的自动构建流程数字,因此只有该进程修改 AssemblyInfo.cs 文件 - 开发人员在安排需要重大版本号更改的次要或主要构建时修改单独的 VersionNumber 文件。
The main downside I can think of is that AssemblyInfo.cs is the source for the various version numbers of the built assemblies.
This doesn't mean that your AssemblyInfo.cs files should not be in source control (they absolutely should in my opinion) but that developers should be very careful about checking them in.
Where I work we have an automated build process that manages the version numbers so only that process modifies the AssemblyInfo.cs files - developers modify a seperate VersionNumber file when they schedule a minor or major build that requires a signifigant version number change.