Assembly version of assemblies with identical names
Hello
I have a Windows.Forms application MyApp.exe running in kiosk mode on
Windows CE, and I want to replace this .exe file with a new version located
on a USB hard disk.
The file on the USB hard disk is also named MyApp.exe and has the same
assembly name, but a different assembly version.
Before replacing the running MyApp.exe I want to make sure that the
MyApp.exe file on the USB is indeed a new version. I have tried to use the
AssemblyName.Version property for this purpose, but it seems that since the
assembly name of the running .exe file is identical to the assembly name of
the .exe file located on the USB, the version of the currently executing
assembly (the running .exe file) is always returned. The code executed by the
running MyApp.exe file is as follows:
Assembly assem = Assembly.LoadFrom(sPathOfExeFileLocatedOnUSB);
AssemblyName assemName = assem.GetName();
return assemName.Version.ToString();
How can i retrieve the assembly version of the .exe file located on the USB
when the executing assembly has the same assembly name?
(This question is a continuation of the post "Replace running .exe file" of
29 June)
Date:Thu, 16 Aug 2007 17:59:21 -0700
Author:
|