Kyl*_*ney 8 c# projects-and-solutions version visual-studio visual-studio-2017
我有一个包含5个C#项目的Visual Studio解决方案.我希望程序集版本在每个项目中都匹配.但看起来我必须进入每个项目的属性并一次单击每个项目的程序集版本.有没有办法处理解决方案,就像它只有一个版本作为一个整体适用于每个项目?
只需GlobalAssemblyInfo.cs在解决方案根文件夹中创建一个文件,然后向其添加必要的属性,最后将其作为现有项目添加到每个项目中作为链接.
在Solution Explorer上点右键project name > Add > Existing item...,并在弹出的对话框中选择Add As Link从下拉列表选项,你可以在此上看到的图像.
// Content of GlobalAssemblyInfo.cs file
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Run Code Online (Sandbox Code Playgroud)
请注意:
Properties\AssemblyInfo.cs文件中删除这些属性.GlobalAssemblyInfo.cs文件中结果是您将只有一个文件可以设置版本,它将应用于所有项目.
| 归档时间: |
|
| 查看次数: |
1828 次 |
| 最近记录: |