エンタープライズExchangeアカウント内に新しいカレンダーを作成したいが、常に同じ「アクセス拒否」例外を取得する 'System.UnauthorizedAccessException 'はmscorlib.ni.dllで発生しましたが、ユーザーコードで処理されませんでした 追加情報:アクセスが拒否されました。 (HRESULTからの例外:0x80070005(E_ACCESSDENIED))これは私のコード、この質問のために簡略化され、多く[UWP] [C#] ExchangeタイプのUserDataAccountで新しいカレンダーを作成する
です:
private const string ExchangeActiveSync = "{6833942B-ABDA-4C20-9757-4F9252396BD4}";
UserDataAccountStore userDataAccountStore = await UserDataAccountManager.RequestStoreAsync(UserDataAccountStoreAccessType.AllAccountsReadOnly);
//Read-only access to app user data accounts and system user data accounts.
//AllAccountsReadOnly = 0,
//Read/write access to the current app's user data accounts.
//AppAccountsReadWrite = 1
//So AllAccountsReadWrite is missing :(
IReadOnlyList<UserDataAccount> listUserAccounts = await userDataAccountStore.FindAccountsAsync();
string accountId= (from account in listUserAccounts where account.DeviceAccountTypeId.Equals(ExchangeActiveSync) select account.Id).FirstOrDefault();
//accountId = "29,0,af";
string calendarName = Package.Current.DisplayName;
//calendarName = "Test Calendar"
AppointmentStore appointmentStore = await AppointmentManager.RequestStoreAsync(AppointmentStoreAccessType.AllCalendarsReadWrite);
var calendar = await appointmentStore.CreateAppointmentCalendarAsync(calendarName, accountId);
//Here the exception is thrown
calendar.OtherAppReadAccess = AppointmentCalendarOtherAppReadAccess.Full;
calendar.OtherAppWriteAccess = AppointmentCalendarOtherAppWriteAccess.None;
await calendar.SaveAsync();
は、私も私のpackage.appxmanifestに必要な制限された機能を追加したが
<rescap:Capability Name="userDataSystem" />
<rescap:Capability Name="userDataAccountsProvider" />
<rescap:Capability Name="appointmentsSystem" />
私は主な問題はUserDataAccountStoreAccessType enumにあると思います。ここでは、 "AllAccountsReadWrite"(カレンダーのアクセスタイプのような)値が欠けています。私はこれが大きな制限だと思います。アカウントのカスタムカレンダーを作成できないのはなぜですか?
私はあなたのサポートのための
どうもありがとうございました。
よろしく、
?このための任意のソリューションがありますので、悪い:(、この制限は、システムのカレンダーアプリでもあることに気づきました
私は私のエンタープライズエクスチェンジクラブ内の新しいカレンダーを作成したいフラビオ