I’m developing a library that tries to get the version number of the application that uses it.
In my test application, when the lib is reading the version number using :
Assembly.GetExecutingAssembly().FullName;
I’m getting the version number of the lib, not the main project.
Is there a simple way to find the version number of the main application, and not the one of my library ?
Thanks.
You can use
Application.Currentto access the application instance that started the application:Having said that, I don’t think have the version number that applies to the application as a whole. For that you’ll need to open the
WMAppManifest.xmlfile and read the version from that. You can get access to the manifest file using: