471,318 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,318 software developers and data experts.

Obtaining object's version

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

TIA,

Richard Rosenheim
Jul 21 '05 #1
2 1066
Richard,

Try the following:

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

Regards,
Michael

"Richard L Rosenheim" <ri*****@rlr.com> schrieb im Newsbeitrag
news:ub**************@tk2msftngp13.phx.gbl...
Given an object, does anyone have any sample code for determining the
version number of it's assembly?

TIA,

Richard Rosenheim

Jul 21 '05 #2
Thanks -- not quite right, but close enough for me to find it. The
corrected line is:

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

Richard
"Michael Groeger" <go*********@web.de> wrote in message
news:eY**************@TK2MSFTNGP12.phx.gbl...
Richard,

Try the following:

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

Regards,
Michael

"Richard L Rosenheim" <ri*****@rlr.com> schrieb im Newsbeitrag
news:ub**************@tk2msftngp13.phx.gbl...
Given an object, does anyone have any sample code for determining the
version number of it's assembly?

TIA,

Richard Rosenheim


Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Richard L Rosenheim | last post: by
1 post views Thread by Chris Edgington | last post: by
11 posts views Thread by seannakasone | last post: by
4 posts views Thread by =?Utf-8?B?anBzaG9ydHN0dWZm?= | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.