title: Get App Version and Build
body: <p>I am working on a Xamarin.Forms app but the iOS versions don't seem to be displaying correctly.</p>
  
  <p>I set the <code>info.plist</code> to Version: 0.0 and Build: 9 but in the app it displays as Version 1.5.174 and Build 674</p>
  
  <pre><code>[assembly: Xamarin.Forms.Dependency(typeof(SocialNetwork.iOS.Version_iOS))]
  namespace SocialNetwork.iOS
  {
  public class Version_iOS : IAppVersion
  {
      public string GetVersion()
      {
          return NSBundle.MainBundle.ObjectForInfoDictionary("CFBundleShortVersionString").ToString();
      }
      public int GetBuild()
      {
          return int.Parse(NSBundle.MainBundle.ObjectForInfoDictionary("CFBundleVersion").ToString());
      }
    }
  }
  </code></pre>
  
  <p>IAppVersion is simply</p>
  
  <pre><code>public interface IAppVersion
  {
      string GetVersion();
      int GetBuild();
  }
  </code></pre>
  
  <p>and I get the value using </p>
  
  <pre><code>public static string AppVersion = DependencyService.Get&lt;IAppVersion&gt;().GetVersion();
      public static int AppBuild = DependencyService.Get&lt;IAppVersion&gt;().GetBuild();
  </code></pre>