I have a mobile application running on .NET Compact Framework 3.5 and an updater application running on the same platform. When user taps on the app shortcut, updater application runs first and checks if a new version of the main app. is available. To do this, I load the main exe assembly using Assembly.LoadFrom method and get the current version. If it finds a new version (via web service) it downloads the new files and replaces. This works fine. The problem is, when it tries the replace main exe file, it fails with this "used by another process" style exception (probably because it's already loaded before). How can I unload this assembly or how can I get its version without loading it?
I've done some research about Assembly class and AppDomain, but .NET CF has some limitations, so I couldn't figure it out.
Any idea?
Thanks.