为 windows 服务 C# 提供版本号

Give Version number to a windows service C#

我做了一个windows服务。我想给它分配一个版本号。我已经检查过关于此的其他一些问题 (Example)。但是在我的项目中,没有属性文件。所以,我完成了以下步骤

完成上述步骤后,在我的项目中创建了一个"Properties"文件夹,其中包含app.manifest文件。重新编译服务后还是看不到版本号(版本号还是0.0.0.0

PS: 这是我第一次尝试进行版本控制。

在属性 AsemblyInfo.cs 中,您可以设置版本以及所有与程序集相关的内容

[assembly: AssemblyTitle("Title")]
[assembly: AssemblyDescription("******")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("*********")]
[assembly: AssemblyProduct("*******")]
[assembly: AssemblyCopyright("*******")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible 
// to COM components.  If you need to access a type in this assembly from 
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]



// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version 
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Build and Revision Numbers 
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.0.0.37")]
[assembly: AssemblyFileVersion("3.0.0.37")]
[assembly: InternalsVisibleTo("*******")]