0

I am developing Xamarin application for iOS, using Visual Studio for Mac.

I need to display version number and last build date on the login screen. I tried to find a solution for auto incrementing and displaying version, but did not find anything that useful. As for the date, I found this solution: solution here

But it does not work for me, since there we are running C# code, but I work on a Mac, so that code won't work, since there is no such thing as .NET Framework for Mac

I tried to include this XML in my csproj file of main project

<PropertyGroup>
  <Copyright>$([System.DateTime]::UtcNow.ToString("s"))</Copyright>
</PropertyGroup>

And this in the C# code

        var version = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
        BuildInfo = version.LegalCopyright;

This gives me correct build date, but it seems like a janky solution

What can you suggest to solve my problem? Thanks

Bhavesh Nayi
  • 3,626
  • 1
  • 27
  • 42
IntegerOverlord
  • 1,477
  • 1
  • 14
  • 33
  • Version info: https://learn.microsoft.com/en-us/xamarin/essentials/version-tracking?context=xamarin/android – Jason Apr 24 '19 at 15:52
  • In Xamarin IOS, you can use `NSBundle.MainBundle.InfoDictionary.ObjectForKey(new NSString("CFBundleShortVersionString"))` to get version of app.However last build date , i have no idea. – Junior Jiang Apr 25 '19 at 03:09

0 Answers0