locked
Additional information: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) for displaying Mesage

    Question

  • Dear team,

                     i am developing Metro app using ContosoCookbook code.the user should login to access the application. but if any user enter wrong username or password. i try to through a message. but i got Access is Denied

    private async void message(string m) { Action cmdAction = null; var msgDlg = new MessageDialog(m, "Race"); msgDlg.Commands.Add(new UICommand("Close", (x) => { cmdAction = () => exit(); })); msgDlg.CancelCommandIndex = 1; await msgDlg.ShowAsync(); cmdAction.Invoke(); }

    void exit()
            {

            }

    kindly help

    Sunday, November 23, 2014 6:02 PM

Answers

  • I will temporary close this issue because the code you provide is totally fine without any problem.

    Another possibility could be you execute the code in a non-UI thread, you can use something like this to fix the issue.

                await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                {
                    message("asdasdasdsadadsadasdsa");
                });

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, December 2, 2014 10:04 AM
    Moderator

All replies

  • Dear team,

                 i am waiting for your reply

    Monday, November 24, 2014 4:51 AM
  • Hi mann,

    Simply create a blank app and paste your code, execute the code by a button click event, but I cannot reproduce the issue.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Monday, November 24, 2014 9:19 AM
    Moderator
  • I will temporary close this issue because the code you provide is totally fine without any problem.

    Another possibility could be you execute the code in a non-UI thread, you can use something like this to fix the issue.

                await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
                {
                    message("asdasdasdsadadsadasdsa");
                });

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, December 2, 2014 10:04 AM
    Moderator