Versioning my Maui Android App raise multiple errors
See original GitHub issueDescription
Previously the way to define version code for Android in Maui .csproj file was like this:
<!-- Versions -->
<ApplicationVersion>3.1.2</ApplicationVersion>
<AndroidVersionCode>3</AndroidVersionCode>
With the new release of Visual Studio Preview, this has changed to:
<ApplicationVersion>3</ApplicationVersion>
It works, from Visual Studio, I can bundle a new .aab package (see image below). We see the version code is defined to 3. Unfortunately the version is defined to 1.0.0.

…when imported on the Google Play Console, it look like this:

Unfortunately, when imported on the Google Play Console I only see the versionCode 3 (which is defined in the .csproj file as ApplicationVersion). What about the versionName (in parentheses) ? Nothing is planned in the .csproj file ? When imported on the Google Play Console, I don’t want to have 3 (1.0.0) but I want 3 (3.1.2)…
https://developer.android.com/studio/publish/versioning
versionCode — A positive integer used as an internal version number. versionName — A string used as the version number shown to users.
Someone suggested me to update my csproj file by adding:
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
or manually set in your androidmanifest.xml: https://github.com/xamarin/xamarin-android/blob/main/Documentation/guides/OneDotNetSingleProject.md
By adjusting my csproj file to add ApplicationDisplayVersion it raise me multiple errors:

Is this a bug ?
As soon as I remove this code in my csproj file, the errors disappeared.
I’m using Visual Studio Professional 2022 - Preview Version 17.1.0 Preview 1.1
I did a maui-check
Steps to Reproduce
By adjusting my csproj file to add ApplicationDisplayVersion it raise me multiple errors:

Version with bug
Visual Studio Professional 2022 - Preview Version 17.1.0 Preview 1.1
Maui Preview 10
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
OS: Windows 10 - Visual Studio Professional 2022 - Preview Version 17.1.0 Preview 1.1
Did you find any workaround?
Manually set inside my AndroidManifest.xml do the trick.


Relevant log output
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:8 (2 by maintainers)

Top Related StackOverflow Question
Same problem here
I have VS 2022 RC, and in a MAUI new app by simply changing the version number in the project file, it creates fatal errors. How to replicate the bug: Change from 1.0 to 0.1
<ApplicationDisplayVersion>0.1</ApplicationDisplayVersion>The error in this case was: Error NETSDK1005 Assets file ‘C:\Users\Pablo\source\repos\Test1\Test1\obj\project.assets.json’ doesn’t have a target for ‘net6.0-windows10.0.19041’. Ensure that restore has run and that you have included ‘net6.0-windows10.0.19041’ in the TargetFrameworks for your project.