Setting / Getting the version of game to show users on WP8

Previously in an XNA based WP7 game I used the following to get the version of a game:
gameVersion = System.Reflection.Assembly.GetExecutingAssembly().FullName.Split(‘=’)[1].Split(‘,’)[0];

When I use the above I get 0.0.0.0 when running the game against the phone directly from Unity, and I get 1.0.0.0 when doing the same from Visual Studio.

I have tried changing every version I can find:
1 - Packaging version under Player Settings for Windows Store app (yes I know this is WP, but there is no equivalent for WP)
2 - Bundle version under Player Settings for iOS / Android, yes still not WP
3 - AssemblyVersion AssemblyFileVersion in AssemblyInfo.cs from Visual Studio
4 - Version under Packaging for WMAppManifest.xml from Visual Studio

None of those change the values I get from the above code.

What is the best / correct way to both set the version and retrieve it at run time for Unity based WP8 game?

Thanks
Mark

Where is that code located? It will return different values depending on where it is.

I attached the code to an object in my first scene, i.e. the one with the Menu that shows “Info” about the game.

So it’s one of your scripts? I’m afraid that will not work. All your scripts are compiled to Assembly-CSharp.dll, which has a hardcoded version of 0.0.0.0.

Of course, you can always use a hardcoded constant as your version number.

Another option would be making a plugin DLL and querying its version.

Thanks for the explanation and possible options. This seems like an obvious omission from Unity?

-Mark

I think so. There isn’t a real need for such API, as it’s pretty trivial to make it yourself.