This code works fine in my WP8 app:
void App_UnhandledException(object sender, UnhandledExceptionEventArgs args)
{
string appName;
string appVersion;
var xmlReaderSettings = new XmlReaderSettings
{
XmlResolver = new XmlXapResolver()
};
using (var xmlReader = XmlReader.Create("WMAppManifest.xml", xmlReaderSettings))
{
xmlReader.ReadToDescendant("App");
appName = xmlReader.GetAttribute("Title");
appVersion = xmlReader.GetAttribute("Version");
}
WAMS_EXCEPTIONLOG wamsel = new WAMS_EXCEPTIONLOG
{
appNameAndVersion =
string.Format("{0} {1}", appName,
appVersion),
ExceptionMsg =
args.ExceptionObject.Message,
InnerException =
args.ExceptionObject
.InnerException.ToString(),
ExceptionToStr =
args.ExceptionObject.ToString(),
dateTimeOffsetStamp =
DateTimeOffset.UtcNow
};
await MobileService.GetTable<TASLS_WAMS_EXCEPTIONLOG>().InsertAsync(wamsel);
}
...but in my complementary Windows store app, several classes and class members are unrecognized, to wit:
XmlResolver
XmlXapResolver
args.ExceptionObject
(not to mention the fact that await is not allowed, and adding "async" to the event handler causes the assignment of the event handler to "go red")...
So, to get back to the main point: How can I achieve the same functionality I'm getting with my WP8 app with my Windows Store app?