在AssemblyInfo有两个集版本:
AssemblyInfo
AssemblyVersion
AssemblyFileVersion
我可以Assembly Version使用以下代码行获取:
Assembly Version
Version version = Assembly.GetEntryAssembly().GetName().Version;
但是我怎么能得到Assembly File Version呢?
Assembly File Version
请参阅上面的我的评论,要求澄清您真正想要的内容。希望是这样:
System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly(); FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location); string version = fvi.FileVersion;