简体   繁体   English

为什么不检入AssemblyInfo.cs

[英]Why not check in AssemblyInfo.cs

I was watching a video on Git and the guy went out of his way to ignore the AssemblyInfo.cs. 我正在观看关于Git的视频,这个人不顾一切地忽略了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? 如果我不检查文件,当他检查我的代码时,Visual Studio是否会抱怨下一个用户?

Some people generate AssemblyInfo.cs from a script when building. 有些人在构建时从脚本生成AssemblyInfo.cs。 That way the date and version numbers can be changed automatically. 这样,日期和版本号可以自动更改。

The main downside I can think of is that AssemblyInfo.cs is the source for the various version numbers of the built assemblies. 我能想到的主要缺点是AssemblyInfo.cs是构建程序集的各种版本号的来源。

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. 这并不意味着你的AssemblyInfo.cs文件不应该在源代码控制中(它们绝对应该在我看来),但开发人员应该非常小心地检查它们。

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. 在我工作的地方,我们有一个自动构建过程来管理版本号,因此只有该过程修改AssemblyInfo.cs文件 - 开发人员在安排需要重大版本号更改的次要或主要版本时修改单独的VersionNumber文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM