Click here to Skip to main content
15,885,309 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I am working on a Windows 8.1 UWP app.

I am facing differences when I had put breakpoints while debugging the app for Windows Phone 8.1 which I am debugging on my Windows Phone 10 device.

Below is code which I am calling from a page in windows phone using a button click :


Can someone please explain what is it that I am missing here.

What I have tried:

private void Button_Click(object sender, RoutedEventArgs e) // Have put the debugger for this method
{
    AuthenticateUser();
}

private async void AuthenticateUser()// On pressing F11, the debugger does not comes here which works when I try to debug the same code which I have it for my Windows 8.1 app
{
    App.service = await App.authHelper.AuthenticateAsync();
    if (App.service != null)
    {
        string folderID = DriveHelper.GetRootFolderId(App.service);
        if (App.service != null)
            this.Frame.Navigate(typeof(DriveHome), folderID);
    }
    else
    {
        // Show ERROR
    }
}



public class AuthenticationHelper
{
    private UserCredential credential;
    private DriveService service;

    public async Task<DriveService> AuthenticateAsync()
    {
        if (service != null)
            return service;
        try
        {
            credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
                new Uri("ms-appx:///Assets/client_secrets.json"),
                new[] { DriveService.Scope.Drive,
                        DriveService.Scope.DriveFile,
                        DriveService.Scope.DriveAppdata,
                        DriveService.Scope.DriveMetadata },
                "user",
                CancellationToken.None);

            var initializer = new BaseClientService.Initializer()
            {
                HttpClientInitializer = credential,
                ApplicationName = "Google Drive Client",
            };

            service = new DriveService(initializer);
        }
        catch(Exception ex)
        {
        }
        return service;
    }
}
Posted
Updated 15-Jan-17 19:02pm
v3

1 solution

Quote:
Breakpoints not working correctly ?

If you suspect a breakpoint not to work properly, add some popup messages in your code to ensure that this piece of code is executed when you expect it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900