繁体   English   中英

AppointmentManager.RequestStoreAsync在Windows Phone中抛出system.unauthorizedaccessexception

[英]AppointmentManager.RequestStoreAsync throws system.unauthorizedaccessexception in Windows Phone

我试图从Windows Phone日历访问约会

public async Task <AppointmentStore> getAppointments()
    {

        AppointmentStore appointmentStore = await  AppointmentManager.RequestStoreAsync(AppointmentStoreAccessType.AllCalendarsReadOnly);
        return appointmentStore;

    }

我已经在PackageManifest文件的Capabilities选项卡中“启用”了“约会”。 在堆栈溢出的其他解决方案中,建议启用我所做的所需权限。 我还以管理员身份运行Visual Studio。 但是,系统继续抛出相同的未授权访问异常。

使用AppointmentStoreAccessType.AppCalendarsReadWrite不会引发任何异常。

使用AppointmentStoreAccessType.AllCalendarsReadOnly会抛出未经授权的异常。 哪个没有害处,不会让应用程序崩溃。 这只是意味着您没有ChangeTracker属性。

您仍然可以使用appointmentStore对象并获取约会和其他内容列表。 检查截图。 在此输入图像描述

我希望你现在可以继续你的项目了吗?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM