Obtaining object's version

  • Thread starter Richard L Rosenheim
  • Start date
R

Richard L Rosenheim

Given an object, does anyone have any sample code for determining the
version number of it's assembly?

TIA,

Richard Rosenheim
 
M

Michael Groeger

Richard,

Try the following:

GetAssemblyVersion(object o)
{
if (o != null)
o.GetType().Assembly.GetName().GetVersion();
}

Regards,
Michael
 
R

Richard L Rosenheim

Thanks -- not quite right, but close enough for me to find it. The
corrected line is:

o.GetType().Assembly.GetName().Version;

Richard
 

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

Top