문제

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

도움이 되었습니까?

해결책

You just need the AssemblyName to get the version :

AssemblyName.GetAssemblyName(filename);

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top