How to get information from AssemblyInfo

elloco999

Well-known member
Joined
Dec 21, 2004
Messages
49
Programming Experience
5-10
Hi,

I was just wondering how I can get information from the AssemblyInfo. For instance, I entered the version number in the AssemblyInfo, how can I get the version number?
I found plenty of info on how to set the version number from the code, but not how to get it...

I want the application to get the version number in the AssemblyInfo, then if a internet connection exists, open a connection to the database on my webserver and check the version number with a number on the database. This way I can check for a newer version...

I thought about storing the version number in a textfile, or the registry, but why bother if it's already in the AssemblyInfo?

Greets,
El Loco
 

elloco999

Well-known member
Joined
Dec 21, 2004
Messages
49
Programming Experience
5-10
Is it also possible to get the version info from another application?

I have 2 applications. Backup and Updater. Backup is just an application I wrote to make scheduled backups of some folders. I use it on several computers, but when I have a new build, I don't want to install it on every computer I use it on. So, I made a update application (Updater). Updater should check the version number of Backup and check it with a version number on my webserver. If there is a newer version, it should download the latest version and install it.

But to do all this, I need to know the version of Backup that is currently installed. So, is it possibe to check the version info of Backup from Updater?

Greets,
El Loco
 

ritesh_jain1982

Well-known member
Joined
Jan 10, 2005
Messages
53
Programming Experience
1-3
Hi,
U can load assembly at runtime using and get it's attribute info as...

asmTitle= System.Reflection.Assembly.LoadFrom("D:\BackUp.exe").GetCustomAttributes(GetType(System.Reflection.AssemblyTitleAttribute), False)(0)

strTitle=asmTitle.Title.Tostring..............

I hope this will help u.....................

Regards,
Ritesh
 

elloco999

Well-known member
Joined
Dec 21, 2004
Messages
49
Programming Experience
5-10
Thanks for the help, but I found a better way to update my application: Use the .NET Application Updater Component. It is written by Microsoft, and even the sourcecode is supplied. I'm still a bit confused by the security part, but that will come to me when I try this I suppose.

So, anyone looking for auto-update functionality in their application have a look at this link

Greets,
El Loco
 
Top Bottom