什么是ExtendedPropertyDefinition UCMeetingSetting用于

时间:2019-02-26 16:18:30

标签: api exchange-server

我在使用交流C#API更新会议时遇到问题。以下代码会产生错误:

Microsoft.Exchange.WebServices.Data.ServiceResponseException:“发生内部服务器错误。该操作失败。,属性:[{000000329-0000-0000-c000-000000000046}:'UCMeetingSetting'] UCMeetingSetting,PropertyErrorCode:未找到, PropertyErrorDescription:。”

代码:

    public Appointment UpdateAppointment(ExchangeCredentials credentials, Appointment appointment)
    {
        var service = CreateMsExchangeService(credentials);

        if (service == null)
        {
            return null;
        }

        try
        {
            var invitation = MsAppointment.Bind(service, new ItemId(appointment.Id), GetAppointmentPropertySet());

            SetMsAppointmentProperties(invitation, appointment);

            //ExtendedPropertyDefinition extendedUCMeetingSetting = new ExtendedPropertyDefinition(
            //    new Guid("{00020329-0000-0000-C000-000000000046}"), "UCMeetingSetting", MapiPropertyType.String);

            //invitation.SetExtendedProperty(extendedUCMeetingSetting, "Lala");

            invitation.Update(ConflictResolutionMode.AutoResolve);

            return appointment;
        }
        catch (Exception exception)
        {
            _logger.LogError(exception, $"Error occured while updating appointment {appointment.Subject.TraceFormat()} for {credentials.Username}");
        }

        return null;
    }

通过添加缺少的属性可以解决此问题,但是我无法弄清楚该扩展属性的值是什么:

    public Appointment UpdateAppointment(ExchangeCredentials credentials, Appointment appointment)
    {
        var service = CreateMsExchangeService(credentials);

        if (service == null)
        {
            return null;
        }

        try
        {
            var invitation = MsAppointment.Bind(service, new ItemId(appointment.Id), GetAppointmentPropertySet());

            SetMsAppointmentProperties(invitation, appointment);

            ExtendedPropertyDefinition extendedUCMeetingSetting = new ExtendedPropertyDefinition(
                new Guid("{00020329-0000-0000-C000-000000000046}"), "UCMeetingSetting", MapiPropertyType.String);

            invitation.SetExtendedProperty(extendedUCMeetingSetting, "Lala");

            invitation.Update(ConflictResolutionMode.AutoResolve);

            return appointment;
        }
        catch (Exception exception)
        {
            _logger.LogError(exception, $"Error occured while updating appointment {appointment.Subject.TraceFormat()} for {credentials.Username}");
        }

        return null;
    }

我的问题:

为什么在我可以将垃圾放入值时需要扩展属性?

该值如何正确显示或是什么?

谢谢

乐土

0 个答案:

没有答案