When building and publishing your Maui app you need to specify your version numbers. Here is how to keep them updated automatically every build.
In your .csproj, the Versions are set here:
These are your version and build number.
In iOS Maui will put these in the info.plist as CFBundleShortVersionString and CFBundleVersion.
In Android Maui will put them in AndroidManifest.xml as versionName and versionCode.
You’re free to use whatever you like for these, as long as they increment for each version. The version is a string, the build is an integer. As you can see, the default for a Maui app is the format “Major.Minor.Revision” (1.0.0) and the build is just a single number: 1.
If you submit this to the App Store you’ll be fine with the defaults. However, the second submission will need to either be 1.0.1 (1) or 1.0.0 (2).
Personally, I’m a big fan of using a timestamp for the build number.
There are several benefits:
So here is a trick with the new Maui .csproj file: you can have it automatically set the build to a timestamp like this:
If you want to use some other format you can:
As long as it’s an integer and always increasing in value when you submit it you’re fine. The version above certainly makes it easy to see when a build was created.
For extra credit show this somewhere (your splash screen, an about page). That way when talking to QA or to end users you can make sure everyone is on the same version. Simply set some properties in your view model:
And then set them in your OnAppearing:
Hope it helps!