如何设置文件版本评论 [英] How to set file version comment

查看:126
本文介绍了如何设置文件版本评论的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在哪里可以设置文件的版本注释..?

Where can I set the file version comments..?

我们可以通过

FileVersionInfo fv = 
System.Diagnostics.FileVersionInfo.GetVersionInfo(
                   Assembly.GetExecutingAssembly().Location);
var comment = fv.Comments;

那么如何设置它,这样我可以显示相同的地方。

Then how can I set it so that I can show the same somewhere..

推荐答案

对于.NET程序集,您可以使用设置文件版本注释的<一个href="http://msdn.microsoft.com/en-us/library/system.reflection.assemblydescriptionattribute%28v=vs.110%29.aspx">AssemblyDescriptionAttribute,您通常使用Visual Studio时放在AssemblyInfo.cs文件在您的项目。

For .NET Assemblies you can set the File Version Comments using the AssemblyDescriptionAttribute, which you usually put in the AssemblyInfo.cs file in your project when using Visual Studio.

[assembly: AssemblyDescription("The assembly does xxx by yyy")]

对于其他类型的可执行文件的文件版本是使用文件中的资源设置。

For other types of executables the file version is set using a resource in the file.

在不同的装配水平的文件版本属性映射如下:

The different assembly level File Version attributes maps as follows:

  • FileVersionInfo.Comments = AssemblyDescription
  • FileVersionInfo.CompanyName = AssemblyCompany
  • FileVersionInfo.FileDescription = AssemblyTitle
  • FileVersionInfo.FileVersion = AssemblyFileVersion
  • FileVersionInfo.LegalCopyright = AssemblyCopyright
  • FileVersionInfo.LegalTrademarks = AssemblyTrademark
  • FileVersionInfo.ProductName = AssemblyProduct
  • FileVersionInfo.ProductVersion = AssemblyInformationalVersion

这篇关于如何设置文件版本评论的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆