I have two version of the same product one on the SD card and one under the "Product Files" directory snd I want to check the version number in the assembly to know if I have to upgrade the software.
to get the version number I do:
Assembly as1 = Assembly.LoadFrom(SDDir + "\\MyApp.exe"Version myVer1 = as1.GetName().Version;
Assembly as2 = Assembly.LoadFrom(PFDir + \\MyApp.exe);
Version myVer2 = as2.GetName().Version;
The problem is that the second call to LoadFrom does not load a new assemly but gets the one from the first call probably from a cash.
that is :
If the SD Card have version 4.0 and the "Program Files" version is 3.0 I get from both LoadFrom calls version 4.0 if I change the order of the calls (First from "Program Files" and second from the SD card) I get version 3.0 for both calls.
I tried to put null in as1 before second load and I also tried to load other Assemly between the two calls nothing helped.
What can I do
Is there another way to check an assembly version number
I need an answer ASAP!!!
Thanks.

How can i check and compare the version number of 2 assemblies
davidlks
Metricon
Are you sur I success to load 2 versions of the same assembly in a same AppDomain with the WinCe6 version.
I juste have to change the major version.
it it really possible to work with 2 versions of the same assembly in one AppDomain with WinCE6 if the major version is different
thanks Jean-Pierre
KoNig
Yes, you are correct that you can load two different versions of the same assembly in an app domain. They should differ in any of major, minor or build numbers. You should be careful about passing around incompatible versions of the same type though.
The exceptions to this are weakly-named assemblies and .Net CF BCLs, of which only one should be loaded.