Question

I have updater for my app. When i check for updates, i compare server version with local Assembly version of main .exe file of application. When from updater(updater is another .exe file) i get assembly version of my main .exe file of application, this file is blocked.. How i can get assembly version of my project without blocking for rewriting? Keep version of assembly in XML file is not good idea. Thanks

Was it helpful?

Solution

You just need the AssemblyName to get the version :

AssemblyName.GetAssemblyName(filename);

OTHER TIPS

A quick (and dirty) way would be to copy the main exe to a temporary file and load it from there.

A more elegant solution would be to create a separate AppDomain and load the main exe there. Since you're only after the version, it should be fairly straightforward to get the data over the bridge between the app domains. The app domain could then be unloaded once you have the version.

I'm assuming you are loading the assembly to check the version.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top