部署时的 C# 项目、正确的版本控制、公司等
我的公司正在努力将我们的开发从 C++.net 转移到 C#。我们的产品有标准的每月版本(例如,5.0.19.2...)。
在 C++.net 中,我们有一个通用的 app.rc 文件,它标准化了公司信息以及版本号。由于解决方案中的每个项目都将包含相同的 app.rc 文件一次,因此更改 200 多个项目的版本信息非常容易。
该解决方案如何转化为 C# 世界?我在写这篇文章之前检查的问题通过解决方案资源管理器中的属性窗口提到了它,但这不是我想要的。
我知道 assemblyinfo.cs 包含我想要修改的信息,但我不认为我可以拥有一个主文件。我需要将其分成多个文件吗?
提前致谢!
My company is working towards moving our development from C++.net into C#. Our product has standard monthly release (for instance, 5.0.19.2...).
In in C++.net, we had a common app.rc file, that standardized the company info, as well as version number. Since every project within the solution would include the same app.rc file once, it was very easy to change the version info on over 200 projects.
How does this solution translate into the C# world? The questions that I checked before writing this mention it through the property window in the solution explorer, but that is not what I want.
I know the assemblyinfo.cs contains the information I want to modify, but I don't think I could have one master file. Do I need to split it up into multiple files?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您可以添加文件作为链接而不是实际文件。例如,我的解决方案可能是:
当您将现有项目添加到解决方案时,您可以使用
添加
链接上的下拉箭头,然后选择添加为链接
。 SharedAssemblyInfo.cs 文件可以包含公共/共享程序集属性,例如:...等。项目本地可以包含项目特定属性:
...等。
You can add a file as a link instead of the actual file. E.g, my solution could be:
When you add an existing item to the solution, you can use the drop down arrow on the
Add
link, and selectAdd as Link
. TheSharedAssemblyInfo.cs
file can contain common/shared assembly attributes, e.g.:... etc. The project local can contain project specific attributes:
... etc.
C# 解决方案中的常见做法是在每个项目的 assemblyinfo.cs 中注释掉版本信息,然后拥有一个通用的“shared_assembleinfo.cs”(按口味命名),其中包含版本信息并在所有项目之间共享...
It's a common practice in c# solutions to comment out version information in the assemblyinfo.cs of each project and then have a single common "shared_assemblyinfo.cs" (named to taste) that contains version information and is shared across all projects...
您可以拥有一个程序集信息文件,并且仅在其中指定程序集版本:
然后,您只需添加 文件作为每个其他项目的链接(您必须从每个项目中删除 AssemblyVersion 属性)不过,
Properties\AssemblyInfo.cs
是手动文件)。当他们构建时,他们都会使用这个文件。You can have one assembly info file and only specify the assembly version in it:
Then, you just add the file as a link to each of your other projects (you'll have to remove the AssemblyVersion attribute from each of the
Properties\AssemblyInfo.cs
files by hand though). When they build, they'll all use this file.可以使用主 assembly.cs - 只需删除项目的 assembly.cs 文件,然后使用“添加文件”对话框中的“作为链接”选项将主 assembly.cs 重新添加到每个项目中。
http:// www.tigraine.at/2009/01/22/sharing-a-common-assembleinfo- Between-projects-in-a-solution/
A master assembly.cs is possible - simply delete your project's assembly.cs file, and re-add a master assembly.cs to every project with the "As a Link" option in the "Add File" dialog.
http://www.tigraine.at/2009/01/22/sharing-a-common-assemblyinfo-between-projects-in-a-solution/
我建议为每个项目提供版本信息,考虑到它们有 400 个或可能如此之大,了解每个新的大型设置中哪些版本的程序集构成该设置的一部分非常重要。每个程序集都由不同的人开发,就像一个单独的项目,最后他们在主应用程序的一个大马赛克中完成,并带有 MainVersion。
问候。
I would suggest to have version information for every project, considering that they are 400 or could be so big, it's extremely important to know on every new big setup which versions of assemblies make part of that setup. Every assembly developed by different person(s) like a separate projects and finally they finished in one big mosaic of your main app, with it's MainVersion.
Regards.