You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Redemption库访问Outlook StoreAccount时遇InvalidCastException异常求助

解决Redemption访问FreeBusyList时的MAPI_E_INTERFACE_NOT_SUPPORTED异常

这个MAPI_E_INTERFACE_NOT_SUPPORTED异常是因为StoreAccount属性仅对Exchange账户生效,从测试方法名CreateMeetingRequest_ZimbraFreeBusy_01能看出你针对的是Zimbra账户,这类第三方MAPI提供者没有实现Redemption获取StoreAccount所需的接口,所以调用stores.DefaultStore.StoreAccount会触发错误。

提供两种可行的解决方式:

  • 直接通过RDO会话的CurrentUser获取忙闲列表,无需走存储账户:

    RDOStores stores = OutlookRedemption.Instance.rdoSession.Stores;
    RDOFreeBusyRange list = OutlookRedemption.Instance.rdoSession.CurrentUser.FreeBusyList;
    
  • 如果需要针对默认存储的所有者获取忙闲信息,改用RDOStore.Owner属性:

    RDOStores stores = OutlookRedemption.Instance.rdoSession.Stores;
    RDOUser storeOwner = stores.DefaultStore.Owner;
    RDOFreeBusyRange list = storeOwner.FreeBusyList;
    

这两种方式都绕开了对StoreAccount的依赖,适配非Exchange类的MAPI账户(比如Zimbra)。

内容的提问来源于stack exchange,提问作者amol surywanshi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.18 07:05:01