In order to dynamically create the link all we have to do is read the manifest file, get the "ProductID" attribute value, and then create the link with the expected format; with this data, we can write a class in C# such as this:

 Code to extract data from WMAppManifest.xml :

Step1: Add this class to your project

 public class DeepLinkHelper
        private const string AppManifestName = "WMAppManifest.xml";
        private const string AppNodeName = "App";
        private const string AppProductIDAttributeName = "ProductID";

        public static string BuildApplicationDeepLink()
            var applicationId = Guid.Parse(GetManifestAttributeValue(AppProductIDAttributeName));

            return BuildApplicationDeepLink(applicationId.ToString());

        public static string BuildApplicationDeepLink(string applicationId)
            return @"" + applicationId;

        public static string GetManifestAttributeValue(string attributeName)
            var xmlReaderSettings = new XmlReaderSettings
                XmlResolver = new XmlXapResolver()

            using (var xmlReader = XmlReader.Create(AppManifestName, xmlReaderSettings))

                if (!xmlReader.IsStartElement())
                    throw new FormatException(AppManifestName + " is missing " + AppNodeName);

                return xmlReader.GetAttribute(attributeName);
Step 2:  Call the DeepLinkHelper.BuildApplicationDeepLink() function of above class  using ShareLinkTask as:

              ShareLinkTask share = new ShareLinkTask();
                share.Title = "My Application Deep Link";
                share.Message = "My Application Deep Link";
                share.LinkUri = new Uri(DeepLinkHelper.BuildApplicationDeepLink());

The most important part of this class is the GetManifestAttributeValue(string) function, that will access the WMAppManifest.xml file and from there retrieve the required information.

Once we have the ApplicationId, we will then use it along the BuildApplicationDeepLink(string) function to return the final link!

Now all we have to do is add this class to our project and then invoke the DeepLinkHelper.BuildApplicationDeepLink() function to retrieve the application deep link, and do with it whatever we'd like (send by email, share on social networks, ...)!.

You will be thinking why should we need to write this code to  extract the "ProductId" from Manifest file because we can simply copy paste ProductId from our Project's WMAppManifest.xml  to our code. So why we need to write the above code.?? .


Its because: "During the app submission process, a new product ID is inserted into the manifest file".

Fig: WMAppManifest.xml  attributes description

 So Whenever the new Product Id is assigned, the above code will retrieve that Id. In this way we can share our Application Successfully! :) .

For details of  WMAppManifest.xml file attributes you can visit :

Test this code:
To see if the above code  works or not, simply download my application in which it is implemented.