Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9127163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:13:12+00:00 2026-06-17T07:13:12+00:00

I want to populate a WAMS table in the UnhandledException event, and I’ve got

  • 0

I want to populate a WAMS table in the UnhandledException event, and I’ve got this code:

private async void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs args)
{
    if (Debugger.IsAttached)
    {
        // An unhandled exception has occurred; break into the debugger
        Debugger.Break();
    }
    PLATYPIRUS_WAMS_EXCEPTIONLOG pruwamsel = new PLATYPIRUS_WAMS_EXCEPTIONLOG();
    pruwamsel.appNameAndVersion = "Platypi R Us for WP8 v. 3.14";
    pruwamsel.ExceptionMsg = args.ExceptionObject.Message;
    pruwamsel.InnerException = args.ExceptionObject.InnerException.ToString();
    pruwamsel.ExceptionToStr = args.ToString();
    pruwamsel.dateTimeOffsetStamp = DateTimeOffset.UtcNow;
    await App.MobileService.GetTable<PLATYPIRUS_WAMS_EXCEPTIONLOG>().InsertAsync(pruwamsel); 
}

…but I don’t really want to hardcode the app name and version. How can I extract those programmatically?

UPDATE

Incorporating the two ideas, I end up with:

private async void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs args)
{
    if (Debugger.IsAttached)
    {
        // An unhandled exception has occurred; break into the debugger
        Debugger.Break();
    }

    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");
    }

    PLATYPIRUS_WAMS_EXCEPTIONLOG pruwamsel = new PLATYPIRUS_WAMS_EXCEPTIONLOG();
    pruwamsel.appNameAndVersion = string.Format("{0} {1}", appName, appVersion);
    pruwamsel.ExceptionMsg = args.ExceptionObject.Message;
    pruwamsel.InnerException = args.ExceptionObject.InnerException.ToString();
    pruwamsel.ExceptionToStr = args.ExceptionObject.ToString();
    pruwamsel.dateTimeOffsetStamp = DateTimeOffset.UtcNow; 
    await App.MobileService.GetTable<PLATYPIRUS_WAMS_EXCEPTIONLOG>().InsertAsync(pruwamsel); 
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:13:13+00:00Added an answer on June 17, 2026 at 7:13 am

    The application name and version are registered in WMAppManifest.xml file.

    By using this this sample and replacing the parts refering to “ProductID” with “Title” and “Version”, I managed to get to this code:

    var xmlReaderSettings = new XmlReaderSettings
    {
        XmlResolver = new XmlXapResolver()
    };
    
    using (var xmlReader = XmlReader.Create("WMAppManifest.xml", xmlReaderSettings))
    {
        xmlReader.ReadToDescendant("App");
    
        var AppName = xmlReader.GetAttribute("Title");
        var AppVersion = xmlReader.GetAttribute("Version");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

whats wrong with this code ? i want populate all users in datagridview1 but
Question: I want to populate a LINQ table from code, not DataBase. Is it
I want to populate a table form a MYSQL database. I have defined the
I want to populate a table, defined in layout xml file through the programmatic
When i want to populate my grid I use this Select command : SELECT
Actually I want to populate an array to fill up my table view, but
I want to populate the alphabet buttons in the activity class like this... My
I want to populate a table column with a running integer number, so I'm
I want to populate my textbox with value from an element. Perhaps my code
I want to populate a predefined html table using JavaScript: <table> <tr> <th scope=col>ID</th>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.