Transcontinental

Hey All!
Is there any way in the compact framework to get the version information for other files in another directory from your app
Thanks in advance!



Re: Smart Devices VB and C# Projects C# Version Info

AndrewBadera

I believe the only way to get this information is by using Reflection, and the assembly you're reflecting on has to be loaded for the current AppDomain, so trying to get information on files in another directory, without them being part of your application, might be out of reach.



Re: Smart Devices VB and C# Projects C# Version Info

Zero Dai - MSFT

Hi friend,

Yes, you can. See the following code:

Code Snippet

Assembly temp = Assembly.LoadFrom(@"\Program Files\DeviceApplication1\DeviceApplication1.exe");// Assembly of another application
this.Text = temp.GetName().Version.ToString();

(in your code, make sure you use full path to the assembly.)

Assembly.LoadFrom can be used to load an assembly with it path.

Regards,

Zero Dai - MSFT






Re: Smart Devices VB and C# Projects C# Version Info

AndrewBadera

Zero Dai - MSFT wrote:

Hi friend,

Yes, you can. See the following code:

Code Snippet

Assembly temp = Assembly.LoadFrom(@"\Program Files\DeviceApplication1\DeviceApplication1.exe");// Assembly of another application
this.Text = temp.GetName().Version.ToString();

(in your code, make sure you use full path to the assembly.)

Assembly.LoadFrom can be used to load an assembly with it path.

Regards,

Zero Dai - MSFT

but, what are the implications of loading that assembly, in terms of memory and overhead