seanrco
seanrco

Reputation: 1079

NET MAUI Application Display Version value incorrect

I am using my NET MAUI project properties > MAUI Shared > General > Application Display Version to set app version (example below):

enter image description here

However, when I call:

AppInfo.Current.Version.ToString()

On my app about page the value is always '1.0.0'.

Am I not using the correct setting?

Edit:

Actually looks like my issue was related to deployment on 'iOS Local Device'. I tested on Android emulator and seeing the correct values:

[Android Emulator] enter image description here

[iOS Local Device] enter image description here

I am learning testing on 'iOS Local Device' does not deploy a lot of features: splash images, icon, and looks like some app info.

Edit 2:

Filed issue on MAUI repo: https://github.com/dotnet/maui/issues/20000

Upvotes: 2

Views: 3917

Answers (3)

Alexandar May - MSFT
Alexandar May - MSFT

Reputation: 10156

According to the docs Application display version:

The application display version for a .NET MAUI app is stored in the app's project file as the ApplicationDisplayVersion build property.

When the value of the Application Display Version field is updated, the value of the Version field in the application view in the Info.plist file will be automatically updated.

And it could be a potential issue or a limitation to correctly get the value of AppInfo.Current.Version only when deploying to iOS Local Device, Android works fine. You can report it to Github:https://github.com/dotnet/maui/issues and hopefully this will be fixed soon.

Hope this clarifies a little bit!

Upvotes: 2

seanrco
seanrco

Reputation: 1079

In my case I was not seeing the correct Application Display Version value only when deploying to 'iOS Local Device'. Tested on 'Android Emulator' and correct value displays.

I am learning testing on 'iOS Local Device' does not deploy a lot of features: app custom splash images, app custom icon, and looks like some app info.

Hope this saves someone time in case they run into the same scenario.

Upvotes: 0

Quoc Nguyen
Quoc Nguyen

Reputation: 29

You are in the right place, you can try to clean solution then run again. This is my illustration:

enter image description here

enter image description here

Upvotes: 2

Related Questions