问题描述
目标:在多个项目中应用程序集文件版本号。
例如,我有10个项目。每个项目都有Property => AssemblyInfo.cs文件。那里你将有如下所示的AssemblyFileVersion标签。
[assembly:AssemblyFileVersion(1.0.0.0)]
我正在使用AssemblyInfo.tt文件,我希望通过该文件应用Fileversion编号。因此,我从AssemblyInfo.cs文件中删除了Fileversion并创建了一个AssemblyInfo.tt文件,其中我提到了Fileversion并将其添加为链接。是的,它应用于项目,我可以在该项目中看到更新的文件版本。
现在因为我有10个项目,每个项目我需要做同样的上述操作,以便它将应用我通过.tt文件提供的实际文件版本。
这个过程很乏味,我在解决方案中有100多个项目我需要为每个应用一个自定义文件版本。
目标是我第一次将.tt文件添加到所有100个项目中,这将是
位于中心位置[项目的上/父文件夹]以后如果我用新的构建和修订号更改.tt文件,它应该自动应用于所有项目。
作为参考,您可以查看以下链接:
http://stackoverflow.com/questions/826777/how-to-have-an-auto-incrementing-version -number-visual-studio
http://vagif.bloggingabout.net/2010/04/24/using-t4-templates-to-man age-assembly-version-information /
[]
了解情况,如果您需要任何额外的信息请告诉我,但不要分享一些无关的例子。
提前致谢!!
Target: Apply an assembly file version number over multiple projects.
For example, I have 10 projects. Each project has Property=> AssemblyInfo.cs file. There you will have AssemblyFileVersion tag as well like below.
[assembly: AssemblyFileVersion("1.0.0.0")]
I am using AssemblyInfo.tt file through which I want to apply Fileversion number. Hence I removed Fileversion from AssemblyInfo.cs file and created a AssemblyInfo.tt file where I mentioned the Fileversion and added it as a link. Yes it is applied to the project and I can see the updated file version in that project.
Now as I have 10 projects, for each project I need to do the same above operation so that it will apply the actual file version which I gave through .tt file.
This process is tedious where I have more than 100 projects in solution and I need to apply a customized file version for each.
The target is for first time I will add .tt file into all 100 projects which will be
in a central position[Upper/parent folder of the projects] and later if I change the .tt file with a new build and revision number it should automatically apply over all projects.
For reference you can look into the below links:
http://stackoverflow.com/questions/826777/how-to-have-an-auto-incrementing-version-number-visual-studio
http://vagif.bloggingabout.net/2010/04/24/using-t4-templates-to-manage-assembly-version-information/
https://msdn.microsoft.com/en-us/library/dd820620.aspx[^]
Understand the situation, If you need any additional information please let me know but don't share some link which are just meaningless examples.
Thanks in advance!!
推荐答案
这篇关于如何在多个项目中应用程序集文件版本号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!