PC Review


Reply
Thread Tools Rate Thread

How to check an assembly's version?

 
 
Tee
Guest
Posts: n/a
 
      7th Feb 2005
Hi,

How can we check an assembly's version that is created in .NET?

I have tried to load the assembly using
System.Reflection.Assembly.LoadFile and

GetCustomAttributes - AssemblyFileVersionAttribute, but couldn't get the
proper data, some of assemblies seem doesn't have
AssemblyFileVersionAttribute.



Can anyone help?



Thanks,

Tee


 
Reply With Quote
 
 
 
 
Peter Rilling
Guest
Posts: n/a
 
      7th Feb 2005
Try Assembly.GetName().Version.


"Tee" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> How can we check an assembly's version that is created in .NET?
>
> I have tried to load the assembly using
> System.Reflection.Assembly.LoadFile and
>
> GetCustomAttributes - AssemblyFileVersionAttribute, but couldn't get the
> proper data, some of assemblies seem doesn't have
> AssemblyFileVersionAttribute.
>
>
>
> Can anyone help?
>
>
>
> Thanks,
>
> Tee
>
>



 
Reply With Quote
 
=?Utf-8?B?TWFyaW51cyBIb2xrZW1h?=
Guest
Posts: n/a
 
      7th Feb 2005
If you want to know the version of your assembly you can use:

Assembly.GetAssembly(typeof(Form1)).GetName().Version.ToString()

Where Form1 is a class defined in the assembly you want to know the version
of.
If you want to know the framework the application is using you could use a
class defined in the framework like:

Assembly.GetAssembly(typeof(int)).GetName().Version.ToString()


 
Reply With Quote
 
Ben Strackany
Guest
Posts: n/a
 
      7th Feb 2005
Try

using System.Reflection;

Assembly.GetExecutingAssembly().GetName().Version.ToString()

--
Ben Strackany
www.developmentnow.com


"Tee" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> How can we check an assembly's version that is created in .NET?
>
> I have tried to load the assembly using
> System.Reflection.Assembly.LoadFile and
>
> GetCustomAttributes - AssemblyFileVersionAttribute, but couldn't get the
> proper data, some of assemblies seem doesn't have
> AssemblyFileVersionAttribute.
>
>
>
> Can anyone help?
>
>
>
> Thanks,
>
> Tee
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The application requires that assembly office Version 12.0.0.0 be installed in the Global Assembly Cache (GAC) first. Bill Nguyen Microsoft VB .NET 2 30th May 2008 11:17 PM
What is the difference between runtime version and the version propery in a .net assembly nenzax Microsoft Dot NET Framework 1 18th Feb 2007 08:24 PM
How to check an assembly's version? Tee Microsoft Dot NET 3 7th Feb 2005 09:04 PM
How to check an assembly's version? Tee Microsoft VB .NET 3 7th Feb 2005 09:04 PM
Assembly version from unloaded assembly bw Microsoft Dot NET Framework 5 14th Aug 2003 06:41 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:42 PM.