Assembly Version

  • Thread starter Thread starter Aamir Mahmood
  • Start date Start date
A

Aamir Mahmood

Hi all,
How can I set the version information (major, minor) in my assembly.
And also how can I easily get it at runtime?

-
AM
 
If you are using Visual Studio .NET IDE created projects, then the file
AssemblyInfo.cs has the AssemblyVersion attribute to spefify the version.

To get the version info at runtime: Assembly.GetName().Version

Hi all,
How can I set the version information (major, minor) in my assembly.
And also how can I easily get it at runtime?

-
AM
 
Hi all,
How can I set the version information (major, minor) in my assembly.
And also how can I easily get it at runtime?

-
AM
Take a look at -> AssemblyInfo.cs

System.Reflection.Assembly a =
System.Reflection.Assembly.GetExecutingAssembly();

System.Reflection.AssemblyName an = a.GetName();
Version v = an.Version;
 
Whenever you create project using VS.Net , IDE automatically creates file
name AssemblyInfo.cs or AssemblyInfo.vb. This file consists of attribute named
"<Assembly: AssemblyVersion("1.0.*")> " here you can specify version number
of your assembly.

To get version number at run time you can use following static function of
Assembly class "Assembly.GetName().Version"

Regards
Manish
 
Back
Top