How to

get assembly version

Published: 9. October 2011 | Updated: 9. October 2011
License: Microsoft Public License (MS-PL)
Categories: Framework » Reflection
Tags: C# Reflection
Was this snippet helpful for you? YESYES / NONO

Import namespace

using System;
using System.Reflection;

Code

Assembly assembly = Assembly.GetExecutingAssembly();
Version version = assembly.GetName().Version;

Console.WriteLine("Version: {0}", version);
Console.WriteLine("Major: {0}", version.Major);
Console.WriteLine("Minor: {0}", version.Minor);
Console.WriteLine("Build: {0}", version.Build);
Console.WriteLine("Revision: {0}", version.Revision);
Send us feedback about this snippet »



Related Snippets: