How to reference both ASSEMBLYVERSION and ASSEMBLYFILEVERSION?
Posted
by Chuck
on Stack Overflow
See other posts from Stack Overflow
or by Chuck
Published on 2009-07-10T19:32:59Z
Indexed on
2010/05/30
15:02 UTC
Read the original article
Hit count: 473
I need to display both the AssemblyVersion and the AssemblyFileVersion. In AssemblyInfo.cs, I have: [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyFileVersion("2009.8.0")]
However, I only get "2009.8.0" when I reference the above with: public class VersionInfo { public static string AppVersion() { return System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).FileMajorPart + "." + System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).FileMinorPart + "." + System.Diagnostics.FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).FileBuildPart; } }
How can I display both values? Thanks.
© Stack Overflow or respective owner