断点无法正常工作? [英] Breakpoints not working correctly ?
问题描述
我正在使用Windows 8.1 UWP应用程序。
我在调试Windows Phone 8.1的应用程序时调试断点时遇到了差异我正在调试在我的Windows Phone 10设备上。
以下是我使用点击按钮从Windows手机中的页面调用的代码:
有人可以解释一下我在这里缺少什么。
我有什么试过:
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;
}
}
推荐答案
断点无法正常工作?
如果您怀疑断点无法正常工作,请在代码中添加一些弹出消息,以确保在执行此代码时执行你期待它。
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.
这篇关于断点无法正常工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!