473,396 Members | 2,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

How to extract the version from Assembly.FullName ?

Hello,
Assembly.FullName give information about a DLL, including the version
w.x.y.z.

Is there a way to extract the version directly from the assembly, or do
I have to extract it from Assembly.FullName?

Thank you
Julien
Nov 16 '05 #1
3 4797
julien <ju****@sobrier.net> wrote in
news:42*********************@news.free.fr:
Hello,
Assembly.FullName give information about a DLL, including the
version w.x.y.z.

Is there a way to extract the version directly from the
assembly, or do I have to extract it from Assembly.FullName?


Julien,

A simple regular expression can be used to extract the assembly's
version number:

Assembly sampleAssembly = Assembly.GetAssembly(1.GetType());
Console.WriteLine(Regex.Match(sampleAssembly.FullN ame, @"\d+\.\d+\.\d+\.\d+").ToString());

--
Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/
Nov 16 '05 #2
Is there a way to extract the version directly from the assembly, or do
I have to extract it from Assembly.FullName?


Assembly.GetName().Version

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 16 '05 #3
Mattias Sjögren wrote:
Is there a way to extract the version directly from the assembly, or do
I have to extract it from Assembly.FullName?

Assembly.GetName().Version

Mattias

Thanks a lot, I missed it in the documentation!
Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: news.microsoft.com | last post by:
Hi, I know how to retrieve the Assembly Version for a WinForm program : Application.ProductVersion. But how to do it for a windows service in C# ??? Thx for your help G.
3
by: Michael Kellogg | last post by:
At the beginning of program execution, I want to compare the executing version of the program against the network copy to see if there's been an update. In the "Properties" window of an EXE, I can...
11
by: Dennis C. Drumm | last post by:
I am trying to find a way to compare the version of the currently executing assembly to the version of my latest upload so I can notify the user when a newer version is available. Is it possible...
3
by: Ken Stealth | last post by:
Hi, Is there a way to obtain the version of .net that my application is riding on (on the server). My app isn't tested nor does it run 100% on V1.1 and for some reason my service provided has...
0
by: Fred | last post by:
Hello, I am using a separate app domain to load an assembly from either disk or cache, create an instance of it and run a method. I then call dispose on the created instance and unload the app...
3
by: Frank Uray | last post by:
Hi all I have a problem with loading a assembly ... I am trying to do the following: - I have a directory with a dll (assembly) in it (not the currect dir.) - I am trying to load this assembly,...
1
by: Basti | last post by:
Hello, I'm working with .Net 2.0. I tried to get attributes of an unloaded assembly. So, the sole way I know is to create a new child application domain, in this app domain I load the assembly,...
11
by: John Brown | last post by:
Hi there, Does anyone know how to extract the full type name ("namespace.type") from an assembly qualified name. Thanks.
1
by: zlf | last post by:
I want to get type name as System.Collections.Generic.IList`1] for typeof(IList<string>). But for now, the closest result I can get is System.Collections.Generic.IList`1] by calling...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.