assembly version

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

how do i read the assembly version (not the file version) of ? tnx..
 
You need to get the AssemblyName object for the assembly. For example, for
the currently executing assembly use:

Version assemblyVersion = Assembly.GetExecutingAssembly().GetName().Version;

To print out the version of every assembly referenced by the main assembly
of you app to this:

foreach(AssemblyName assemblyName in
Assembly.GetEntryAssembly().GetReferencedAssemblies())
{
// Print out the name and version of the assemblies
Console.WriteLine(assemblyName.Name + "\t" + assemblyName.Version);
}


Hope this helps.

Brian Delahunty
Ireland

http://briandela.com/blog
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top