解决方法
看看
the source code for WP7DataCollector.GetAppAttribute()在
Microsoft Silverlight Analytics Framework. GetAppAttribute(“标题”)会做到这一点.
/// <summary> /// Gets an attribute from the Windows Phone App Manifest App element /// </summary> /// <param name="attributeName">the attribute name</param> /// <returns>the attribute value</returns> private static string GetAppAttribute(string attributeName) { string appManifestName = "WMAppManifest.xml"; string appNodeName = "App"; var settings = new XmlReaderSettings(); settings.XmlResolver = new XmlXapResolver(); using (XmlReader rdr = XmlReader.Create(appManifestName,settings)) { rdr.ReadToDescendant(appNodeName); if (!rdr.IsStartElement()) { throw new System.FormatException(appManifestName + " is missing " + appNodeName); } return rdr.GetAttribute(attributeName); } }