Getting the message "The sharing message is not supported." while sharing the calendar using ews managed api.

  public void ShareCalendar(Calendar calendar)
            ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);
              service.Credentials = new NetworkCredential("user1", "password", "domain");
            service.Url = new Uri("https://sampleUrl/ews/exchange.asmx");
            try
                // Bind to the folder
                //Folder folderStoreInfo;
                //folderStoreInfo = Folder.Bind(service, calendar.ExchangeId);
                //string EwsID = folderStoreInfo.Id.UniqueId;
                string EwsID = calendar.FolderExchangeId;
                // The value of folderidHex will be what we need to use for the FolderId in the xml file
                AutodiscoverService autoDiscover = new AutodiscoverService(ExchangeVersion.Exchange2013);
                autoDiscover.Credentials =  new NetworkCredential("user1", "password", "domain");
                autoDiscover.RedirectionUrlValidationCallback = RedirectionUrlValidationCallback;
                Dictionary<string, string> userSettings = GetUserSettings(autoDiscover);
                string folderidHex = GetConvertedEWSIDinHex(service, EwsID, "[email protected]");
                string domainName = string.Empty;
                string mailBoxServer = string.Empty;
                string userName = string.Empty;
                foreach (var item in userSettings)
                    switch (item.Key)
                        case "UserDN":
                            domainName = item.Value.ToString();
                            break;
                        case "InternalMailboxServer":
                            mailBoxServer = item.Value.ToString();
                            break;
                        case "UserDisplayName":
                            userName = item.Value.ToString();
                            break;
                string entryId = GetIntiatorEntryID(domainName);
                string mailboxId = GetInvitationMailboxId(mailBoxServer, domainName);
                string sharedFilePath = CreateSharingMessageAttachment(folderidHex, userName, entryId, mailboxId, "[email protected]", "calendar", calendar.FolderName);
                // Create a new message
                EmailMessage invitationRequest = new EmailMessage(service);
                invitationRequest.Subject = "I'd like to share my calendar with you";
                invitationRequest.Body = "Sent by Exchange Administrator on behalf of user";                
                //invitationRequest.Culture = "en-US";
                invitationRequest.Sensitivity = Sensitivity.Normal;
                // Set a sharing specific property on the message
                invitationRequest.ItemClass = "IPM.Sharing"; /* Constant Required Value [MS-ProtocolSpec] */
                byte[] byteEntryId = HexStringToByteArray(entryId);
                // This is the Guid of the Sharing Provider in Exchange, and it's value does not change
                Guid binSharingProviderGuid = new Guid("{AEF00600-0000-0000-C000-000000000046}");
                // Even though I don't think setting this property is mandatory, 
                // it just seemed like the right thing to do and it works so I \
                // ain't messin with it!                                        
                byte[] byteSharingProviderGuid = binSharingProviderGuid.ToByteArray();
                string strPRBODYHTML = "<html dir=\"ltr\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\r\n<meta name=\"GENERATOR\"
content=\"MSHTML 8.00.7601.17514\">\r\n<style id=\"owaParaStyle\">P {\r\n   MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px \r\n}\r\n</style>\r\n</head>\r\n<body fPStyle=\"1\" ocsi=\"0\">\r\n<tt>\r\n<pre>SharedByUserDisplayName
(SharedByUserSmtpAddress) has invited you to view his or her Microsoft Exchange Calendar.\r\n\r\nFor instructions on how to view shared folders on Exchange, see the following article:\r\n\r\nhttp://go.microsoft.com/fwlink/?LinkId=57561\r\n\r\n*~*~*~*~*~*~*~*~*~*\r\n\r\n</pre>\r\n</tt>\r\n<div>\r\n<div
style=\"direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;\">this is a test message</div>\r\n</div>\r\n</body>\r\n</html>\r\n";
                string strBODY = @"
SharedByUserDisplayName (SharedByUserSmtpAddress) has invited you to view his or
her Microsoft Exchange Calendar.
For instructions on how to view shared folders on Exchange, see the
following article:
http://go.microsoft.com/fwlink/?LinkId=57561
*~*~*~*~*~*~*~*~*~*
test body
                // Convert these to hex and binary equivelants to assign to their relevant
                // extended properties
                string hexPRBODYHTML = ConvertStringToHex(strPRBODYHTML);
                byte[] binPRBODYHTML = HexStringToByteArray(hexPRBODYHTML);
                Guid PropertySetSharing = Guid.Parse("00062040-0000-0000-C000-000000000046");//constant 
                Guid PropertySetInternetHeaders = Guid.Parse("00020386-0000-0000-C000-000000000046");//constant
                ExtendedPropertyDefinition PidLidSharingProviderGuidProperty = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A01, MapiPropertyType.CLSID);
                ExtendedPropertyDefinition ConversationIdProperty = new ExtendedPropertyDefinition(0x3013, MapiPropertyType.Binary);
                // Sharing Properties (in order of reference according to protocol examples in: [MS-OXSHARE])
                // Additional Property Constraints
                // [MS-OXSHARE] 2.2.5.2
                ExtendedPropertyDefinition PidTagMessageClass = new ExtendedPropertyDefinition(0x001A, MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.5.1
                //ExtendedPropertyDefinition PidNameContentClass = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.InternetHeaders, "Content-Class", MapiPropertyType.String);
                ExtendedPropertyDefinition PidNameContentClass = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "Content-class", MapiPropertyType.String);
                // Common Message Object Properties               
                // [MS-OXSHARE] 2.2.1
                ExtendedPropertyDefinition PidTagNormalizedSubject = new ExtendedPropertyDefinition(0x0E1D, MapiPropertyType.String);
                // The PidTagSubjectPrefix is a zero-length string, so I do not set it
                // ExtendedPropertyDefinition PidTagSubjectPrefix = new ExtendedPropertyDefinition(0x003D, MapiPropertyType.String);
                // Sharing Object Message Properties
                // [MS-OXSHARE] 2.2.2.12
                ExtendedPropertyDefinition PidLidSharingProviderGuid = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A01, MapiPropertyType.Binary);
                // [MS-OXSHARE] 2.2.2.13
                ExtendedPropertyDefinition PidNameXSharingProviderGuid = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Provider-GUID", MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.2.14
                ExtendedPropertyDefinition PidLidSharingProviderName = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A02, MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.2.15           
                ExtendedPropertyDefinition PidNameXSharingProviderName = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Provider-Name", MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.2.16
                ExtendedPropertyDefinition PidLidSharingProviderUrl = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A03, MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.2.17
                ExtendedPropertyDefinition PidNameXSharingProviderUrl = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Provider-URL", MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.2.5
                ExtendedPropertyDefinition PidLidSharingFlavor = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A18, MapiPropertyType.Integer);
                // [MS-OXSHARE] 2.2.2.6
                ExtendedPropertyDefinition PidNameXSharingFlavor = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Flavor", MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.2.1
                ExtendedPropertyDefinition PidLidSharingCapabilities = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A17, MapiPropertyType.Integer);
                // [MS-OXSHARE] 2.2.2.2
                ExtendedPropertyDefinition PidNameXSharingCapabilities = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Capabilities", MapiPropertyType.String);
                // Sections 2.3 and 2.4 are also zero-length strings, so I won't set those either
                // [MS-OXSHARE] 2.2.2.3
                // ExtendedPropertyDefinition PidLidSharingConfigurationUrl = new   //ExtendedPropertyDefinition(PropertySetSharing, 0x8A24, MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.2.4
                //ExtendedPropertyDefinition PidNameXSharingConfigUrl = new //ExtendedPropertyDefinition(DefaultExtendedPropertySet.InternetHeaders, "X-Sharing-Config-Url", MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.2.10
                ExtendedPropertyDefinition PidLidSharingLocalType = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A14, MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.2.11
                ExtendedPropertyDefinition PidNameXSharingLocalType = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Local-Type", MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.2.7
                ExtendedPropertyDefinition PidLidSharingInitiatorEntryId = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A09, MapiPropertyType.Binary);
                // [MS-OXSHARE] 2.2.2.8
                ExtendedPropertyDefinition PidLidSharingInitiatorName = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A07, MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.2.9
                ExtendedPropertyDefinition PidLidSharingInitiatorSMTP = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A08, MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.3.1
                ExtendedPropertyDefinition PidLidSharingRemoteName = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A05, MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.3.2 
                ExtendedPropertyDefinition PidNameXSharingRemoteName = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Name", MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.3.5 
                ExtendedPropertyDefinition PidLidSharingRemoteType = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A1D, MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.3.6 
                ExtendedPropertyDefinition PidNameXSharingRemoteType = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Type", MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.3.7 
                ExtendedPropertyDefinition PidLidSharingRemoteUid = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A06, MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.3.8 
                ExtendedPropertyDefinition PidNameXSharingRemoteUid = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Uid", MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.3.3
                ExtendedPropertyDefinition PidLidSharingRemoteStoreUid = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A48, MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.3.4
                ExtendedPropertyDefinition PidNameXSharingRemoteStoreUid = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Store-Uid", MapiPropertyType.String);
                //From troubleshooting I noticed I was missing
                ExtendedPropertyDefinition PidTagPriority = new ExtendedPropertyDefinition(0x0026, MapiPropertyType.Integer);
                ExtendedPropertyDefinition PidTagSensitivity = new ExtendedPropertyDefinition(0x0036, MapiPropertyType.Integer);
                ExtendedPropertyDefinition PR_BODY_HTML = new ExtendedPropertyDefinition(0x1013, MapiPropertyType.Binary); //PR_BOD
                ExtendedPropertyDefinition PR_BODY = new ExtendedPropertyDefinition(0x1000, MapiPropertyType.String);
                ExtendedPropertyDefinition RecipientReassignmentProhibited = new ExtendedPropertyDefinition(0x002b, MapiPropertyType.Boolean);
                // Section 2.2.1
                invitationRequest.SetExtendedProperty(PidTagNormalizedSubject, "I'd like to share my calendar with you"); /* Constant Required Value [MS-OXSHARE] 2.2.1 */
                //invitationRequest.SetExtendedProperty(PidTagSubjectPrefix, String.Empty); /* Constant Required Value [MS-OXSHARE] 2.2.1 */
                // Section 2.2.2
                invitationRequest.SetExtendedProperty(PidLidSharingCapabilities, 0x40220); /* value for Special Folders */
                invitationRequest.SetExtendedProperty(PidNameXSharingCapabilities, "40220"); /* Test representation of SharingCapabilities value */
                //invitationRequest.SetExtendedProperty(PidLidSharingConfigurationUrl, String.Empty); /* Zero-Length String [MS-OXSHARE] 2.2.2.3 */
                //invitationRequest.SetExtendedProperty(PidNameXSharingConfigUrl, String.Empty); /* Zero-Length String [MS-OXSHARE] 2.2.2.4 */
                invitationRequest.SetExtendedProperty(PidLidSharingFlavor, 0x20310); /* Indicates Invitation for a special folder [MS-OXSHARE] 2.2.2.5 */
                invitationRequest.SetExtendedProperty(PidNameXSharingFlavor, "20310"); /* Text representation of SharingFlavor value [MS-OXSHARE] 2.2.2.6 */
                invitationRequest.SetExtendedProperty(PidLidSharingInitiatorEntryId, byteEntryId); /* Value from the Initiator/EntryId value in the Sharing Message attachment .xml document */
                invitationRequest.SetExtendedProperty(PidLidSharingInitiatorSMTP, "[email protected]"); /* Value from Initiator/Smtp Address in the Sharing message attachment .xml document */
                invitationRequest.SetExtendedProperty(PidLidSharingInitiatorName, "User1"); /* Value from Initiator/Name Address in the Sharing message attachment .xml document */
                invitationRequest.SetExtendedProperty(PidLidSharingLocalType, "IPF.Appointment"); /* MUST be set to PidTagContainerClass of folder to be shared */
                invitationRequest.SetExtendedProperty(PidNameXSharingLocalType, "IPF.Appointment"); /* MUST be set to same value as PidLidSharingLocalType */
                invitationRequest.SetExtendedProperty(PidLidSharingProviderGuid, byteSharingProviderGuid); /* Constant Required Value [MS-OXSHARE] 2.2.2.12 */
                invitationRequest.SetExtendedProperty(PidNameXSharingProviderGuid, "AEF0060000000000C000000000000046"); /* Constant Required Value [MS-OXSHARE] 2.2.2.13 */
                invitationRequest.SetExtendedProperty(PidLidSharingProviderName, "Microsoft Exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.14 */
                invitationRequest.SetExtendedProperty(PidNameXSharingProviderName, "Microsoft Exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.15] */
                invitationRequest.SetExtendedProperty(PidLidSharingProviderUrl, "http://www.microsoft.com/exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.16 */
                invitationRequest.SetExtendedProperty(PidNameXSharingProviderUrl, "http://www.microsoft.com/exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.17 */
                // Section 2.2.3
                invitationRequest.SetExtendedProperty(PidLidSharingRemoteName, calendar.FolderName); /* MUST be set to PidTagDisplayName of the folder being shared */
                invitationRequest.SetExtendedProperty(PidNameXSharingRemoteName, calendar.FolderName); /* MUST be set to same value as PidLidSharingRemoteName */
                invitationRequest.SetExtendedProperty(PidLidSharingRemoteStoreUid, mailboxId); /* Must be set to PidTagStoreEntryId of the folder being shared */
                invitationRequest.SetExtendedProperty(PidNameXSharingRemoteStoreUid, mailboxId); /* MUST be set to same value as PidLidSharingRemoteStoreUid */
                invitationRequest.SetExtendedProperty(PidLidSharingRemoteType, "IPF.Appointment"); /* Constant Required Value [MS-OXSHARE] 2.2.3.5 */
                invitationRequest.SetExtendedProperty(PidNameXSharingRemoteType, "IPF.Appointment"); /* Constant Required Value [MS-OXSHARE] 2.2.3.6 */
                invitationRequest.SetExtendedProperty(PidLidSharingRemoteUid, folderidHex); /* MUST be set to PidTagEntryId of folder being shared */
                invitationRequest.SetExtendedProperty(PidNameXSharingRemoteUid, folderidHex); /* Must be set to same value as PidLidSharingRemoteUid */
                // Section 2.2.5
                invitationRequest.SetExtendedProperty(PidNameContentClass, "Sharing"); /* Constant Required Value [MS-ProtocolSpec] */
                invitationRequest.SetExtendedProperty(PidTagMessageClass, "IPM.Sharing"); /* Constant Required Value [MS-ProtocolSpec] */
                // ********* ADDITIONAL MAPPED PROPERTIES IM FINDING AS I TROUBLESHOOT ********************** //
                invitationRequest.SetExtendedProperty(PidTagPriority, 0); /* From troubleshooting I'm just trying to match up values that were missing */
                invitationRequest.SetExtendedProperty(PidTagSensitivity, 0); /* From troubleshooting as well */
                invitationRequest.SetExtendedProperty(PR_BODY_HTML, binPRBODYHTML); /* From troubleshooting OWA error pointing to serializing HTML failing */
                invitationRequest.SetExtendedProperty(PR_BODY, strBODY);
                invitationRequest.SetExtendedProperty(RecipientReassignmentProhibited, true); /* Because it seemed like a good idea */
                // Add a file attachment by using a stream
                // We need to do the following in order to prevent 3 extra bytes from being prepended to the attachment
                string sharMetadata = File.ReadAllText(sharedFilePath, Encoding.ASCII);
                byte[] fileContents;
                UTF8Encoding encoding = new System.Text.UTF8Encoding();
                fileContents = encoding.GetBytes(sharMetadata);
                //fileContents = File.ReadAllBytes(sharedFilePath);
                //// fileContents is a Stream object that represents the content of the file to attach.
                invitationRequest.Attachments.AddFileAttachment("sharing_metadata.xml", fileContents);
                ////invitationRequest.Attachments.AddFileAttachment(sharedFilePath);
                //// This is where we set those "special" headers and other pertinent
                //// information I noted in Part 1 of this series...
                //Attachment thisAttachment = invitationRequest.Attachments[0];
                //thisAttachment.ContentType = "application/x-sharing-metadata-xml";
                //thisAttachment.Name = "sharing_metadata.xml";
                //thisAttachment.IsInline = false;
                // Add recipient info and send message
                invitationRequest.ToRecipients.Add(new EmailAddress() { Address = "[email protected]" });
                invitationRequest.SendAndSaveCopy();
                // I always end my methods by returning the EWS 
                // impersonated user to null to clean up
                service.ImpersonatedUserId = null;
            catch (Exception ex)
        public String GetConvertedEWSIDinHex(ExchangeService esb, String sID, String strSMTPAdd)
            // Create a request to convert identifiers.
            AlternateId objAltID = new AlternateId();
            objAltID.Format = IdFormat.EwsId;
            objAltID.Mailbox = strSMTPAdd;
            objAltID.UniqueId = sID;
            //Convert  PR_ENTRYID identifier format to an EWS identifier.
            AlternateIdBase objAltIDBase = esb.ConvertId(objAltID, IdFormat.HexEntryId);
            AlternateId objAltIDResp = (AlternateId)objAltIDBase;
            return objAltIDResp.UniqueId.ToString();
        public String GetInvitationMailboxId(string mailBoxServer, string domainName)
            ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);
            service.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, "[email protected]");
            // Generate The Store Entry Id for the impersonated user
            StringBuilder MailboxIDPointer = new StringBuilder();          
            string fqdn = mailBoxServer;
            string legacyDN = domainName;
            MailboxIDPointer.Append("00000000"); /* Flags */
            MailboxIDPointer.Append("38A1BB1005E5101AA1BB08002B2A56C2"); /* ProviderUID */
            MailboxIDPointer.Append("00"); /* Version */
            MailboxIDPointer.Append("00"); /* Flag */
            MailboxIDPointer.Append("454D534D44422E444C4C00000000"); /* DLLFileName */
            MailboxIDPointer.Append("00000000"); /* Wrapped Flags */
            MailboxIDPointer.Append("1B55FA20AA6611CD9BC800AA002FC45A"); /* WrappedProvider UID (Mailbox Store Object) */
            MailboxIDPointer.Append("0C000000"); /* Wrapped Type (Mailbox Store) */
            MailboxIDPointer.Append(ConvertStringToHex(fqdn)); /* ServerShortname (FQDN) */
            MailboxIDPointer.Append("00"); /* termination bit */
            MailboxIDPointer.Append(ConvertStringToHex(legacyDN)); /* Returns the userDN of the impersonated user */
            MailboxIDPointer.Append("00"); /* terminator bit */
            service.ImpersonatedUserId = null;
            return MailboxIDPointer.ToString();
        static bool RedirectionUrlValidationCallback(String redirectionUrl)
            bool redirectionValidated = false;
            if (redirectionUrl.Equals("https://SampleUrl/autodiscover/autodiscover.xml"))          
                redirectionValidated = true;
            return redirectionValidated;
        public String GetIntiatorEntryID(string domainName)
            String result = String.Empty;
            //// Bind to EWS
            //ExchangeService service = ExchangeConnection.ExchangeService();
            //service.ImpersonatedUserId =
            //new ImpersonatedUserId(ConnectingIdType.SmtpAddress, "[email protected]");
            //// Get LegacyDN Using the function above this one 
            string sharedByLegacyDN = domainName;
            // A conversion function from earlier
            string legacyDNinHex = ConvertStringToHex(sharedByLegacyDN);
            StringBuilder addBookEntryId = new StringBuilder();
            addBookEntryId.Append("00000000"); /* Flags */
            addBookEntryId.Append("DCA740C8C042101AB4B908002B2FE182"); /* ProviderUID */
            addBookEntryId.Append("01000000"); /* Version */
            addBookEntryId.Append("00000000"); /* Type - 00 00 00 00  = Local Mail User */
            addBookEntryId.Append(legacyDNinHex); /* Returns the userDN of the impersonated user */
            addBookEntryId.Append("00"); /* terminator bit */
            result = addBookEntryId.ToString();
            //service.ImpersonatedUserId = null;
            return result;
        public string ConvertStringToHex(string input)
            // Take our input and break it into an array
            char[] arrInput = input.ToCharArray();
            String result = String.Empty;
            // For each set of characters
            foreach (char element in arrInput)
                if (String.IsNullOrEmpty(result))
                    result = String.Format("{0:X2}", Convert.ToUInt16(element)).ToString();
                else
                    result += String.Format("{0:X2}", Convert.ToUInt16(element)).ToString();
            return result.ToString();
 public string CreateSharingMessageAttachment(string folderid, string userSharing, string userSharingEntryID, string invitationMailboxID, string userSharedTo, string dataType, string calendarName)
            XmlDocument sharedMetadataXML = new XmlDocument();
            string sharedMetaDataFilePath = string.Empty;
            try
                // Create a String that contains our new sharing_metadata.xml file
                StringBuilder metadataString = new StringBuilder("<?xml version=\"1.0\"?>");              
                metadataString.Append("<SharingMessage xmlns=\"http://schemas.microsoft.com/sharing/2008\">");
                metadataString.Append("<DataType>" + dataType + "</DataType>");
                metadataString.Append("<Initiator>");
                metadataString.Append("<Name>" + userSharing + "</Name>");
                metadataString.Append("<SmtpAddress>" + "[email protected]" + "</SmtpAddress><EntryId>" + userSharingEntryID.Trim());
                metadataString.Append("</EntryId>");
                metadataString.Append("</Initiator>");
                metadataString.Append("<Invitation>");
                metadataString.Append("<Title>" + calendarName + "</Title>");
                metadataString.Append("<Providers>");
                metadataString.Append("<Provider Type=\"ms-exchange-internal\" TargetRecipients=\"" + userSharedTo + "\">");
                metadataString.Append("<FolderId xmlns=\"http://schemas.microsoft.com/exchange/sharing/2008\">");
                metadataString.Append(folderid);
                metadataString.Append("</FolderId>");
                metadataString.Append("<MailboxId xmlns=\"http://schemas.microsoft.com/exchange/sharing/2008\">");
                metadataString.Append(invitationMailboxID);
                metadataString.Append("</MailboxId>");
                metadataString.Append("</Provider>");
                metadataString.Append("</Providers>");
                metadataString.Append("</Invitation>");
                metadataString.Append("</SharingMessage>");
                sharedMetadataXML.LoadXml(metadataString.ToString());
                string tempPath = System.IO.Path.GetTempPath();
                sharedMetaDataFilePath = tempPath + "sharing_metadata.xml";
                sharedMetadataXML.Save(sharedMetaDataFilePath);
            catch (Exception eg)
                throw eg;               
            return sharedMetaDataFilePath;
        public Dictionary<string, string> GetUserSettings(AutodiscoverService autodiscoverService)
            GetUserSettingsResponse userresponse = autodiscoverService.GetUserSettings(
                "[email protected]",
                UserSettingName.UserDisplayName,
                UserSettingName.InternalMailboxServerDN,
                UserSettingName.UserDN
            Dictionary<string, string> myUserSettings = new Dictionary<string, string>();
            foreach (KeyValuePair<UserSettingName, Object> usersetting in userresponse.Settings)
                if (usersetting.Key.ToString() == "InternalMailboxServerDN")
                    int lastIndexOfEqual = usersetting.Value.ToString().LastIndexOf("=");
                    string subString = usersetting.Value.ToString().Substring(lastIndexOfEqual + 1);
                    string value = subString;
                    myUserSettings.Add("InternalMailboxServer", value.ToString());
                if (usersetting.Key.ToString() == "UserDisplayName")
                    string[] arrResult = usersetting.Value.ToString().Split('.');
                    myUserSettings.Add("UserDisplayName", arrResult[0].ToString());
                if (usersetting.Key.ToString() == "UserDN")
                    string[] arrResult = usersetting.Value.ToString().Split('.');
                    myUserSettings.Add("UserDN", arrResult[0].ToString());
            return myUserSettings;
        private static byte[] HexStringToByteArray(string input)
            byte[] Bytes;
            int ByteLength;
            string HexValue = "\x0\x1\x2\x3\x4\x5\x6\x7\x8\x9|||||||\xA\xB\xC\xD\xE\xF";
            ByteLength = input.Length / 2;
            Bytes = new byte[ByteLength];
            for (int x = 0, i = 0; i < input.Length; i += 2, x += 1)
                Bytes[x] = (byte)(HexValue[Char.ToUpper(input[i + 0]) - '0'] << 4);
                Bytes[x] |= (byte)(HexValue[Char.ToUpper(input[i + 1]) - '0']);
            return Bytes;

Hi,
I'm trying to share a calendar through ews managed api v.2 and using exchange 2013 version.
i'm preparing a shared calendar and providing values to extended properties .
Here comes the problem when i'm trying to send the sharing request(email message) 
The following is code snippet.
  public void ShareCalendar(Calendar calendar)
            ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);
              service.Credentials = new NetworkCredential("user1", "password", "domain");
            service.Url = new Uri("https://sampleUrl/ews/exchange.asmx");
            try
                // Bind to the folder
                //Folder folderStoreInfo;
                //folderStoreInfo = Folder.Bind(service, calendar.ExchangeId);
                //string EwsID = folderStoreInfo.Id.UniqueId;
                string EwsID = calendar.FolderExchangeId;
                // The value of folderidHex will be what we need to use for the FolderId in the xml file
                AutodiscoverService autoDiscover = new AutodiscoverService(ExchangeVersion.Exchange2013);
                autoDiscover.Credentials =  new NetworkCredential("user1", "password", "domain");
                autoDiscover.RedirectionUrlValidationCallback = RedirectionUrlValidationCallback;
                Dictionary<string, string> userSettings = GetUserSettings(autoDiscover);
                string folderidHex = GetConvertedEWSIDinHex(service, EwsID, "[email protected]");
                string domainName = string.Empty;
                string mailBoxServer = string.Empty;
                string userName = string.Empty;
                foreach (var item in userSettings)
                    switch (item.Key)
                        case "UserDN":
                            domainName = item.Value.ToString();
                            break;
                        case "InternalMailboxServer":
                            mailBoxServer = item.Value.ToString();
                            break;
                        case "UserDisplayName":
                            userName = item.Value.ToString();
                            break;
                string entryId = GetIntiatorEntryID(domainName);
                string mailboxId = GetInvitationMailboxId(mailBoxServer, domainName);
                string sharedFilePath = CreateSharingMessageAttachment(folderidHex, userName, entryId, mailboxId, "[email protected]", "calendar", calendar.FolderName);
                // Create a new message
                EmailMessage invitationRequest = new EmailMessage(service);
                invitationRequest.Subject = "I'd like to share my calendar with you";
                invitationRequest.Body = "Sent by Exchange Administrator on behalf of user";                
                //invitationRequest.Culture = "en-US";
                invitationRequest.Sensitivity = Sensitivity.Normal;
                // Set a sharing specific property on the message
                invitationRequest.ItemClass = "IPM.Sharing"; /* Constant Required Value [MS-ProtocolSpec] */
                byte[] byteEntryId = HexStringToByteArray(entryId);
                // This is the Guid of the Sharing Provider in Exchange, and it's value does not change
                Guid binSharingProviderGuid = new Guid("{AEF00600-0000-0000-C000-000000000046}");
                // Even though I don't think setting this property is mandatory, 
                // it just seemed like the right thing to do and it works so I \
                // ain't messin with it!                                        
                byte[] byteSharingProviderGuid = binSharingProviderGuid.ToByteArray();
                string strPRBODYHTML = "<html dir=\"ltr\">\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\r\n<meta name=\"GENERATOR\"
content=\"MSHTML 8.00.7601.17514\">\r\n<style id=\"owaParaStyle\">P {\r\n   MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px \r\n}\r\n</style>\r\n</head>\r\n<body fPStyle=\"1\" ocsi=\"0\">\r\n<tt>\r\n<pre>SharedByUserDisplayName
(SharedByUserSmtpAddress) has invited you to view his or her Microsoft Exchange Calendar.\r\n\r\nFor instructions on how to view shared folders on Exchange, see the following article:\r\n\r\nhttp://go.microsoft.com/fwlink/?LinkId=57561\r\n\r\n*~*~*~*~*~*~*~*~*~*\r\n\r\n</pre>\r\n</tt>\r\n<div>\r\n<div
style=\"direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;\">this is a test message</div>\r\n</div>\r\n</body>\r\n</html>\r\n";
                string strBODY = @"
SharedByUserDisplayName (SharedByUserSmtpAddress) has invited you to view his or
her Microsoft Exchange Calendar.
For instructions on how to view shared folders on Exchange, see the
following article:
http://go.microsoft.com/fwlink/?LinkId=57561
*~*~*~*~*~*~*~*~*~*
test body
                // Convert these to hex and binary equivelants to assign to their relevant
                // extended properties
                string hexPRBODYHTML = ConvertStringToHex(strPRBODYHTML);
                byte[] binPRBODYHTML = HexStringToByteArray(hexPRBODYHTML);
                Guid PropertySetSharing = Guid.Parse("00062040-0000-0000-C000-000000000046");//constant 
                Guid PropertySetInternetHeaders = Guid.Parse("00020386-0000-0000-C000-000000000046");//constant
                ExtendedPropertyDefinition PidLidSharingProviderGuidProperty = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A01, MapiPropertyType.CLSID);
                ExtendedPropertyDefinition ConversationIdProperty = new ExtendedPropertyDefinition(0x3013, MapiPropertyType.Binary);
                // Sharing Properties (in order of reference according to protocol examples in: [MS-OXSHARE])
                // Additional Property Constraints
                // [MS-OXSHARE] 2.2.5.2
                ExtendedPropertyDefinition PidTagMessageClass = new ExtendedPropertyDefinition(0x001A, MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.5.1
                //ExtendedPropertyDefinition PidNameContentClass = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.InternetHeaders, "Content-Class", MapiPropertyType.String);
                ExtendedPropertyDefinition PidNameContentClass = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "Content-class", MapiPropertyType.String);
                // Common Message Object Properties               
                // [MS-OXSHARE] 2.2.1
                ExtendedPropertyDefinition PidTagNormalizedSubject = new ExtendedPropertyDefinition(0x0E1D, MapiPropertyType.String);
                // The PidTagSubjectPrefix is a zero-length string, so I do not set it
                // ExtendedPropertyDefinition PidTagSubjectPrefix = new ExtendedPropertyDefinition(0x003D, MapiPropertyType.String);
                // Sharing Object Message Properties
                // [MS-OXSHARE] 2.2.2.12
                ExtendedPropertyDefinition PidLidSharingProviderGuid = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A01, MapiPropertyType.Binary);
                // [MS-OXSHARE] 2.2.2.13
                ExtendedPropertyDefinition PidNameXSharingProviderGuid = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Provider-GUID", MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.2.14
                ExtendedPropertyDefinition PidLidSharingProviderName = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A02, MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.2.15           
                ExtendedPropertyDefinition PidNameXSharingProviderName = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Provider-Name", MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.2.16
                ExtendedPropertyDefinition PidLidSharingProviderUrl = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A03, MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.2.17
                ExtendedPropertyDefinition PidNameXSharingProviderUrl = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Provider-URL", MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.2.5
                ExtendedPropertyDefinition PidLidSharingFlavor = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A18, MapiPropertyType.Integer);
                // [MS-OXSHARE] 2.2.2.6
                ExtendedPropertyDefinition PidNameXSharingFlavor = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Flavor", MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.2.1
                ExtendedPropertyDefinition PidLidSharingCapabilities = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A17, MapiPropertyType.Integer);
                // [MS-OXSHARE] 2.2.2.2
                ExtendedPropertyDefinition PidNameXSharingCapabilities = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Capabilities", MapiPropertyType.String);
                // Sections 2.3 and 2.4 are also zero-length strings, so I won't set those either
                // [MS-OXSHARE] 2.2.2.3
                // ExtendedPropertyDefinition PidLidSharingConfigurationUrl = new   //ExtendedPropertyDefinition(PropertySetSharing, 0x8A24, MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.2.4
                //ExtendedPropertyDefinition PidNameXSharingConfigUrl = new //ExtendedPropertyDefinition(DefaultExtendedPropertySet.InternetHeaders, "X-Sharing-Config-Url", MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.2.10
                ExtendedPropertyDefinition PidLidSharingLocalType = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A14, MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.2.11
                ExtendedPropertyDefinition PidNameXSharingLocalType = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Local-Type", MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.2.7
                ExtendedPropertyDefinition PidLidSharingInitiatorEntryId = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A09, MapiPropertyType.Binary);
                // [MS-OXSHARE] 2.2.2.8
                ExtendedPropertyDefinition PidLidSharingInitiatorName = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A07, MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.2.9
                ExtendedPropertyDefinition PidLidSharingInitiatorSMTP = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A08, MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.3.1
                ExtendedPropertyDefinition PidLidSharingRemoteName = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A05, MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.3.2 
                ExtendedPropertyDefinition PidNameXSharingRemoteName = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Name", MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.3.5 
                ExtendedPropertyDefinition PidLidSharingRemoteType = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A1D, MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.3.6 
                ExtendedPropertyDefinition PidNameXSharingRemoteType = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Type", MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.3.7 
                ExtendedPropertyDefinition PidLidSharingRemoteUid = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A06, MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.3.8 
                ExtendedPropertyDefinition PidNameXSharingRemoteUid = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Uid", MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.3.3
                ExtendedPropertyDefinition PidLidSharingRemoteStoreUid = new ExtendedPropertyDefinition(PropertySetSharing, 0x8A48, MapiPropertyType.String);
                // [MS-OXSHARE] 2.2.3.4
                ExtendedPropertyDefinition PidNameXSharingRemoteStoreUid = new ExtendedPropertyDefinition(PropertySetInternetHeaders, "X-Sharing-Remote-Store-Uid", MapiPropertyType.String);
                //From troubleshooting I noticed I was missing
                ExtendedPropertyDefinition PidTagPriority = new ExtendedPropertyDefinition(0x0026, MapiPropertyType.Integer);
                ExtendedPropertyDefinition PidTagSensitivity = new ExtendedPropertyDefinition(0x0036, MapiPropertyType.Integer);
                ExtendedPropertyDefinition PR_BODY_HTML = new ExtendedPropertyDefinition(0x1013, MapiPropertyType.Binary); //PR_BOD
                ExtendedPropertyDefinition PR_BODY = new ExtendedPropertyDefinition(0x1000, MapiPropertyType.String);
                ExtendedPropertyDefinition RecipientReassignmentProhibited = new ExtendedPropertyDefinition(0x002b, MapiPropertyType.Boolean);
                // Section 2.2.1
                invitationRequest.SetExtendedProperty(PidTagNormalizedSubject, "I'd like to share my calendar with you"); /* Constant Required Value [MS-OXSHARE] 2.2.1 */
                //invitationRequest.SetExtendedProperty(PidTagSubjectPrefix, String.Empty); /* Constant Required Value [MS-OXSHARE] 2.2.1 */
                // Section 2.2.2
                invitationRequest.SetExtendedProperty(PidLidSharingCapabilities, 0x40220); /* value for Special Folders */
                invitationRequest.SetExtendedProperty(PidNameXSharingCapabilities, "40220"); /* Test representation of SharingCapabilities value */
                //invitationRequest.SetExtendedProperty(PidLidSharingConfigurationUrl, String.Empty); /* Zero-Length String [MS-OXSHARE] 2.2.2.3 */
                //invitationRequest.SetExtendedProperty(PidNameXSharingConfigUrl, String.Empty); /* Zero-Length String [MS-OXSHARE] 2.2.2.4 */
                invitationRequest.SetExtendedProperty(PidLidSharingFlavor, 0x20310); /* Indicates Invitation for a special folder [MS-OXSHARE] 2.2.2.5 */
                invitationRequest.SetExtendedProperty(PidNameXSharingFlavor, "20310"); /* Text representation of SharingFlavor value [MS-OXSHARE] 2.2.2.6 */
                invitationRequest.SetExtendedProperty(PidLidSharingInitiatorEntryId, byteEntryId); /* Value from the Initiator/EntryId value in the Sharing Message attachment .xml document */
                invitationRequest.SetExtendedProperty(PidLidSharingInitiatorSMTP, "[email protected]"); /* Value from Initiator/Smtp Address in the Sharing message attachment .xml document */
                invitationRequest.SetExtendedProperty(PidLidSharingInitiatorName, "User1"); /* Value from Initiator/Name Address in the Sharing message attachment .xml document */
                invitationRequest.SetExtendedProperty(PidLidSharingLocalType, "IPF.Appointment"); /* MUST be set to PidTagContainerClass of folder to be shared */
                invitationRequest.SetExtendedProperty(PidNameXSharingLocalType, "IPF.Appointment"); /* MUST be set to same value as PidLidSharingLocalType */
                invitationRequest.SetExtendedProperty(PidLidSharingProviderGuid, byteSharingProviderGuid); /* Constant Required Value [MS-OXSHARE] 2.2.2.12 */
                invitationRequest.SetExtendedProperty(PidNameXSharingProviderGuid, "AEF0060000000000C000000000000046"); /* Constant Required Value [MS-OXSHARE] 2.2.2.13 */
                invitationRequest.SetExtendedProperty(PidLidSharingProviderName, "Microsoft Exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.14 */
                invitationRequest.SetExtendedProperty(PidNameXSharingProviderName, "Microsoft Exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.15] */
                invitationRequest.SetExtendedProperty(PidLidSharingProviderUrl, "http://www.microsoft.com/exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.16 */
                invitationRequest.SetExtendedProperty(PidNameXSharingProviderUrl, "http://www.microsoft.com/exchange"); /* Constant Required Value [MS-OXSHARE] 2.2.2.17 */
                // Section 2.2.3
                invitationRequest.SetExtendedProperty(PidLidSharingRemoteName, calendar.FolderName); /* MUST be set to PidTagDisplayName of the folder being shared */
                invitationRequest.SetExtendedProperty(PidNameXSharingRemoteName, calendar.FolderName); /* MUST be set to same value as PidLidSharingRemoteName */
                invitationRequest.SetExtendedProperty(PidLidSharingRemoteStoreUid, mailboxId); /* Must be set to PidTagStoreEntryId of the folder being shared */
                invitationRequest.SetExtendedProperty(PidNameXSharingRemoteStoreUid, mailboxId); /* MUST be set to same value as PidLidSharingRemoteStoreUid */
                invitationRequest.SetExtendedProperty(PidLidSharingRemoteType, "IPF.Appointment"); /* Constant Required Value [MS-OXSHARE] 2.2.3.5 */
                invitationRequest.SetExtendedProperty(PidNameXSharingRemoteType, "IPF.Appointment"); /* Constant Required Value [MS-OXSHARE] 2.2.3.6 */
                invitationRequest.SetExtendedProperty(PidLidSharingRemoteUid, folderidHex); /* MUST be set to PidTagEntryId of folder being shared */
                invitationRequest.SetExtendedProperty(PidNameXSharingRemoteUid, folderidHex); /* Must be set to same value as PidLidSharingRemoteUid */
                // Section 2.2.5
                invitationRequest.SetExtendedProperty(PidNameContentClass, "Sharing"); /* Constant Required Value [MS-ProtocolSpec] */
                invitationRequest.SetExtendedProperty(PidTagMessageClass, "IPM.Sharing"); /* Constant Required Value [MS-ProtocolSpec] */
                // ********* ADDITIONAL MAPPED PROPERTIES IM FINDING AS I TROUBLESHOOT ********************** //
                invitationRequest.SetExtendedProperty(PidTagPriority, 0); /* From troubleshooting I'm just trying to match up values that were missing */
                invitationRequest.SetExtendedProperty(PidTagSensitivity, 0); /* From troubleshooting as well */
                invitationRequest.SetExtendedProperty(PR_BODY_HTML, binPRBODYHTML); /* From troubleshooting OWA error pointing to serializing HTML failing */
                invitationRequest.SetExtendedProperty(PR_BODY, strBODY);
                invitationRequest.SetExtendedProperty(RecipientReassignmentProhibited, true); /* Because it seemed like a good idea */
                // Add a file attachment by using a stream
                // We need to do the following in order to prevent 3 extra bytes from being prepended to the attachment
                string sharMetadata = File.ReadAllText(sharedFilePath, Encoding.ASCII);
                byte[] fileContents;
                UTF8Encoding encoding = new System.Text.UTF8Encoding();
                fileContents = encoding.GetBytes(sharMetadata);
                //fileContents = File.ReadAllBytes(sharedFilePath);
                //// fileContents is a Stream object that represents the content of the file to attach.
                invitationRequest.Attachments.AddFileAttachment("sharing_metadata.xml", fileContents);
                ////invitationRequest.Attachments.AddFileAttachment(sharedFilePath);
                //// This is where we set those "special" headers and other pertinent
                //// information I noted in Part 1 of this series...
                //Attachment thisAttachment = invitationRequest.Attachments[0];
                //thisAttachment.ContentType = "application/x-sharing-metadata-xml";
                //thisAttachment.Name = "sharing_metadata.xml";
                //thisAttachment.IsInline = false;
                // Add recipient info and send message
                invitationRequest.ToRecipients.Add(new EmailAddress() { Address = "[email protected]" });
                invitationRequest.SendAndSaveCopy();
                // I always end my methods by returning the EWS 
                // impersonated user to null to clean up
                service.ImpersonatedUserId = null;
            catch (Exception ex)
        public String GetConvertedEWSIDinHex(ExchangeService esb, String sID, String strSMTPAdd)
            // Create a request to convert identifiers.
            AlternateId objAltID = new AlternateId();
            objAltID.Format = IdFormat.EwsId;
            objAltID.Mailbox = strSMTPAdd;
            objAltID.UniqueId = sID;
            //Convert  PR_ENTRYID identifier format to an EWS identifier.
            AlternateIdBase objAltIDBase = esb.ConvertId(objAltID, IdFormat.HexEntryId);
            AlternateId objAltIDResp = (AlternateId)objAltIDBase;
            return objAltIDResp.UniqueId.ToString();
        public String GetInvitationMailboxId(string mailBoxServer, string domainName)
            ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);
            service.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, "[email protected]");
            // Generate The Store Entry Id for the impersonated user
            StringBuilder MailboxIDPointer = new StringBuilder();          
            string fqdn = mailBoxServer;
            string legacyDN = domainName;
            MailboxIDPointer.Append("00000000"); /* Flags */
            MailboxIDPointer.Append("38A1BB1005E5101AA1BB08002B2A56C2"); /* ProviderUID */
            MailboxIDPointer.Append("00"); /* Version */
            MailboxIDPointer.Append("00"); /* Flag */
            MailboxIDPointer.Append("454D534D44422E444C4C00000000"); /* DLLFileName */
            MailboxIDPointer.Append("00000000"); /* Wrapped Flags */
            MailboxIDPointer.Append("1B55FA20AA6611CD9BC800AA002FC45A"); /* WrappedProvider UID (Mailbox Store Object) */
            MailboxIDPointer.Append("0C000000"); /* Wrapped Type (Mailbox Store) */
            MailboxIDPointer.Append(ConvertStringToHex(fqdn)); /* ServerShortname (FQDN) */
            MailboxIDPointer.Append("00"); /* termination bit */
            MailboxIDPointer.Append(ConvertStringToHex(legacyDN)); /* Returns the userDN of the impersonated user */
            MailboxIDPointer.Append("00"); /* terminator bit */
            service.ImpersonatedUserId = null;
            return MailboxIDPointer.ToString();
        static bool RedirectionUrlValidationCallback(String redirectionUrl)
            bool redirectionValidated = false;
            if (redirectionUrl.Equals("https://SampleUrl/autodiscover/autodiscover.xml"))          
                redirectionValidated = true;
            return redirectionValidated;
        public String GetIntiatorEntryID(string domainName)
            String result = String.Empty;
            //// Bind to EWS
            //ExchangeService service = ExchangeConnection.ExchangeService();
            //service.ImpersonatedUserId =
            //new ImpersonatedUserId(ConnectingIdType.SmtpAddress, "[email protected]");
            //// Get LegacyDN Using the function above this one 
            string sharedByLegacyDN = domainName;
            // A conversion function from earlier
            string legacyDNinHex = ConvertStringToHex(sharedByLegacyDN);
            StringBuilder addBookEntryId = new StringBuilder();
            addBookEntryId.Append("00000000"); /* Flags */
            addBookEntryId.Append("DCA740C8C042101AB4B908002B2FE182"); /* ProviderUID */
            addBookEntryId.Append("01000000"); /* Version */
            addBookEntryId.Append("00000000"); /* Type - 00 00 00 00  = Local Mail User */
            addBookEntryId.Append(legacyDNinHex); /* Returns the userDN of the impersonated user */
            addBookEntryId.Append("00"); /* terminator bit */
            result = addBookEntryId.ToString();
            //service.ImpersonatedUserId = null;
            return result;
        public string ConvertStringToHex(string input)
            // Take our input and break it into an array
            char[] arrInput = input.ToCharArray();
            String result = String.Empty;
            // For each set of characters
            foreach (char element in arrInput)
                if (String.IsNullOrEmpty(result))
                    result = String.Format("{0:X2}", Convert.ToUInt16(element)).ToString();
                else
                    result += String.Format("{0:X2}", Convert.ToUInt16(element)).ToString();
            return result.ToString();
 public string CreateSharingMessageAttachment(string folderid, string userSharing, string userSharingEntryID, string invitationMailboxID, string userSharedTo, string dataType, string calendarName)
            XmlDocument sharedMetadataXML = new XmlDocument();
            string sharedMetaDataFilePath = string.Empty;
            try
                // Create a String that contains our new sharing_metadata.xml file
                StringBuilder metadataString = new StringBuilder("<?xml version=\"1.0\"?>");              
                metadataString.Append("<SharingMessage xmlns=\"http://schemas.microsoft.com/sharing/2008\">");
                metadataString.Append("<DataType>" + dataType + "</DataType>");
                metadataString.Append("<Initiator>");
                metadataString.Append("<Name>" + userSharing + "</Name>");
                metadataString.Append("<SmtpAddress>" + "[email protected]" + "</SmtpAddress><EntryId>" + userSharingEntryID.Trim());
                metadataString.Append("</EntryId>");
                metadataString.Append("</Initiator>");
                metadataString.Append("<Invitation>");
                metadataString.Append("<Title>" + calendarName + "</Title>");
                metadataString.Append("<Providers>");
                metadataString.Append("<Provider Type=\"ms-exchange-internal\" TargetRecipients=\"" + userSharedTo + "\">");
                metadataString.Append("<FolderId xmlns=\"http://schemas.microsoft.com/exchange/sharing/2008\">");
                metadataString.Append(folderid);
                metadataString.Append("</FolderId>");
                metadataString.Append("<MailboxId xmlns=\"http://schemas.microsoft.com/exchange/sharing/2008\">");
                metadataString.Append(invitationMailboxID);
                metadataString.Append("</MailboxId>");
                metadataString.Append("</Provider>");
                metadataString.Append("</Providers>");
                metadataString.Append("</Invitation>");
                metadataString.Append("</SharingMessage>");
                sharedMetadataXML.LoadXml(metadataString.ToString());
                string tempPath = System.IO.Path.GetTempPath();
                sharedMetaDataFilePath = tempPath + "sharing_metadata.xml";
                sharedMetadataXML.Save(sharedMetaDataFilePath);
            catch (Exception eg)
                throw eg;               
            return sharedMetaDataFilePath;
        public Dictionary<string, string> GetUserSettings(AutodiscoverService autodiscoverService)
            GetUserSettingsResponse userresponse = autodiscoverService.GetUserSettings(
                "[email protected]",
                UserSettingName.UserDisplayName,
                UserSettingName.InternalMailboxServerDN,
                UserSettingName.UserDN
            Dictionary<string, string> myUserSettings = new Dictionary<string, string>();
            foreach (KeyValuePair<UserSettingName, Object> usersetting in userresponse.Settings)
                if (usersetting.Key.ToString() == "InternalMailboxServerDN")
                    int lastIndexOfEqual = usersetting.Value.ToString().LastIndexOf("=");
                    string subString = usersetting.Value.ToString().Substring(lastIndexOfEqual + 1);
                    string value = subString;
                    myUserSettings.Add("InternalMailboxServer", value.ToString());
                if (usersetting.Key.ToString() == "UserDisplayName")
                    string[] arrResult = usersetting.Value.ToString().Split('.');
                    myUserSettings.Add("UserDisplayName", arrResult[0].ToString());
                if (usersetting.Key.ToString() == "UserDN")
                    string[] arrResult = usersetting.Value.ToString().Split('.');
                    myUserSettings.Add("UserDN", arrResult[0].ToString());
            return myUserSettings;
        private static byte[] HexStringToByteArray(string input)
            byte[] Bytes;
            int ByteLength;
            string HexValue = "\x0\x1\x2\x3\x4\x5\x6\x7\x8\x9|||||||\xA\xB\xC\xD\xE\xF";
            ByteLength = input.Length / 2;
            Bytes = new byte[ByteLength];
            for (int x = 0, i = 0; i < input.Length; i += 2, x += 1)
                Bytes[x] = (byte)(HexValue[Char.ToUpper(input[i + 0]) - '0'] << 4);
                Bytes[x] |= (byte)(HexValue[Char.ToUpper(input[i + 1]) - '0']);
            return Bytes;
am i missing anything 
any help is appreciated 
Thanks in advance

Similar Messages

  • I am new to apple hardware, and since upgrading software on my iphone 4S I receive this message.  "this accessory is not supported by this iphone" when using my clock radio docking station. Is there away around this?

    I am new to apple hardware, and since upgrading software on my iphone 4S I receive this message.  "this accessory is not supported by this iphone" when using my clock radio docking station. Is there away around this?

    Hello GuynStPete,
    Thanks for using Apple Support Communities.
    I found the following support article that has some troubleshooting steps for you to follow in order to resolve this issue you're experiencing:
    Resolve issues with iPhone, iPad, and iPod touch accessories
    http://support.apple.com/kb/TS2634
    Take care,
    Alex H.

  • How to get list of Users[MailBoxes] in Exchange Server 2013 by using EWS Managed API

    Hi all,
    I need list of Users exists in my Exchange server 2013 , i.e Mail Box Users login name.
    I was  created Full Access permissions of all users to Admin user account,  to access each user Mailbox programatically 
    i need the list of Mailboxes in exchange server .
    MailBox  mailbox = new MailBox("user");
    Please share your ideas

    Hi,
    We can run the following command in Exchange Management Shell to get all user mailboxes name and export it to a .csv file:
    Get-Mailbox -ResultSize Unlimited | Select Name,Alias,RecipientTypeDetails | Export-Csv c:\Users.csv
    If you want to retrieve the list of users by using EWS Managed API, I suggest you can ask a question in Exchange Development forum for more suggestion:
    http://social.technet.microsoft.com/Forums/en-US/exchangesvrdevelopment/threads
    Regards,
    Winnie Liang
    TechNet Community Support

  • Get list of User Mailboxes in Exchange server 2013 by using EWS managed API

    Hi all,
    I need list of Users exists in my Exchange server 2013 , i.e Mail Box Users log in name.
    i know the command in Powershell  to get list, but i need this using code[ ews managed API].
    How can i achieve this ?
    Please share your ideas

    Hi Glen,
    i follow your suggested links i wrote below code ,
    here i am getting error  
    The term 'Get-Users' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
    SecureString password = new SecureString();
    string str_password = "EIS2014!@#";
    string username = "[email protected]";
    foreach (char x in str_password) { password.AppendChar(x); }
    PSCredential credential = new PSCredential(username, password);
    WSManConnectionInfo connectionInfo = new WSManConnectionInfo(new Uri("http://ExchangeServer.admin.com/powershell"), "http://schemas.microsoft.com/powershell/Microsoft.Exchange", credential);
    //connectionInfo.AuthenticationMechanism = AuthenticationMechanism.Basic;
    Runspace runspace = RunspaceFactory.CreateRunspace(connectionInfo);
    PowerShell powershell = PowerShell.Create();
    PSCommand command = new PSCommand();
    command.AddCommand("Get-Users");
    command.AddParameter("ResultSize", 50);
    powershell.Commands = command;
    runspace.Open();
    powershell.Runspace = runspace;
    var aa = powershell.Invoke();
    Please help me.

  • [office365 Exchange online][MVC5][EWS Managed Api] Need a hack to get access token ?

    Hi there, I am using following code example to get access token from Azure AD online. I need to bridge EWS managed api with office 365 Api via Azure AD. The below code is working just fine in my MVC application but I am looking for a way to get the access
    token in simple string returning  function so that I can use it to make call against EWS mananged api.
    private static string tempToken = "";
    public static string GetAccessToken()
    return tempToken;
    internal static async Task<OutlookServicesClient> EnsureOutlookServicesClientCreatedAsync(string capabilityName)
    var signInUserId = ClaimsPrincipal.Current.FindFirst(ClaimTypes.NameIdentifier).Value;
    var userObjectId = ClaimsPrincipal.Current.FindFirst("http://schemas.microsoft.com/identity/claims/objectidentifier").Value;
    AuthenticationContext authContext = new AuthenticationContext(Settings.Authority, new NaiveSessionCache(signInUserId));
    try
    DiscoveryClient discClient = new DiscoveryClient(Settings.DiscoveryServiceEndpointUri,
    async () =>
    var authResult = await authContext.AcquireTokenSilentAsync(Settings.DiscoveryServiceResourceId,
    new ClientCredential(Settings.ClientId,
    Settings.AppKey),
    new UserIdentifier(userObjectId,
    UserIdentifierType.UniqueId));
    return authResult.AccessToken;
    var dcr = await discClient.DiscoverCapabilityAsync(capabilityName);
    return new OutlookServicesClient(dcr.ServiceEndpointUri,
    async () =>
    var authResult = await authContext.AcquireTokenSilentAsync(dcr.ServiceResourceId,
    new ClientCredential(Settings.ClientId,
    Settings.AppKey),
    new UserIdentifier(userObjectId,
    UserIdentifierType.UniqueId));
    return authResult.AccessToken;
    catch (AdalException exception)
    //Handle token acquisition failure
    if (exception.ErrorCode == AdalError.FailedToAcquireTokenSilently)
    authContext.TokenCache.Clear();
    return null;
    This is an excerpt from Microsoft single tenant application in MVC5.  In the code, I have created a function called GetAccessToken() which does nothing.. I am hoping you experts can help me figure out how to transfer the accessToken from EnsureOutlookServcesClientCreated
    function which is actually returning token, to  my GetAccessToken() so that I can make call against EWS managed Api. Sorry, If I sound pretty stupid but I really need your help in this regard. 
    best regards,

    Yes sir, Let me try to explain me about my scenario. I need to use EWS managed Api with office 365 Rest Api to get benefits from both the Apis. Here is here code I am using to connect to EWS managed Api but it is failing with 401:Unauthorized.  I already
    have "Full Access" turned on in Azure AD.  I have the access token from AZure AD and want to use it to make call against EWS managed Api.
    var outlookClient = await AuthHelper.EnsureOutlookServicesClientCreatedAsync("Mail");
    //IPagedCollection<IMessage> messagesResults = await outlookClient.Me.Messages.ExecuteAsync();
    // Get the ID of the first message.
    // string messageId = messagesResults.CurrentPage[0].Id;
    string tokenx = AuthHelper.GetAccessToken();
    ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);
    service.HttpHeaders.Add("Authorization", "Bearer " + tokenx);
    service.PreAuthenticate = true;
    service.SendClientLatencies = true;
    service.EnableScpLookup = false;
    service.Url = new Uri("https://outlook.office365.com/EWS/Exchange.asmx");
    // Get all the folders in the message's root folder.
    ExFolder rootfolder = ExFolder.Bind(service, WellKnownFolderName.MsgFolderRoot);S
    Scenario of my migration application:
    1. I have a Gmail mailbox email in Raw(complete email in base64-urlsafe with attachments) format with RFC2822. I need to migrate this mailbox to Exchange online. I believe EWS managed Api has better support on this one.
    2.  Likewise I need to migrate Gmail Calendars, Tasks and Contacts to Exchange online.
    I would be highly grateful to you , if you tell me how to bridge EWS managed Api with office 365 Api.
    best regards,

  • I downloaded Firefox 4 onto my PowerPC G4 1.67GHz running Mac OSX 10.5.6. When I try to open it I get error message You cannot open the application "Firefox" because it is not supported on this architecture. I can't find my Firefox 3.6.16 I'm on Safari.

    I just want to download Firefox 3.6 again
    I downloaded Firefox 4 onto my PowerPC G4, 1.67GHz running Mac OSX 10.5.6. When I try to open it I get error message You cannot open the application “Firefox” because it is not supported on this architecture.

    Use Tony's suggestion. I am running it right now and it is awesome. I love Mozilla but they basically screwed all of those older Macs over. Come on Mozilla. These Macs still work, and there are plenty of people with them out there.

  • What do I do when I try to open Fifrefox 4 & get the message: The procedure entry point NS_SetDllDirectory could not be located in the dynamic link library xul.dll?

    2 days ago, I got a message about upgrading to Firefox 4.0. I didn't do it immediately, due to lack of time. Later that day, I tried to open Firfox & got the message: Firefox can't start because xul.dll is missing. Reinstall the program to fix this. I tried several times to open Firefox & got the same result. I tried rebooting. Same result. So I opened Internet Explorer & went to the Firefox website & followed the instructions to download Firefox 4. After that, I used it last night & left my laptop hibernating last night, then continued to use it this morning. Then I closed Firefox. When I next tried to reopen Firefox, I got the new message: The procedure entry point NS_SetDllDirectory could not be located in the dynamic link library xul.dll. Again, I can only access the internet with Internet Explorer. Also, I have a done a good many Windows updates over the last 2 days as well. What can I do to get Firefox to open? Thank you for your help.

    This is what I did to resolve this problem. First, I uninstalled Firefox 4 & removed the Firefox folder left behind. I made sure to NOT select the option to delete personal information. Next, I backed up all of the important files on my computer. Next, I upgraded my Windows 7 to Service Pack 1, which was pending in my updates folder. Then, I went to Mozilla's website & downloaded Firefox 4 again, making sure to select only the Firefox browser and not Thunderbird too. http://www.mozilla.org/ When prompted to close any open programs, I closed Internet Explorer (which I had used to get to the Mozilla website) and I disabled my Norton anti-virus. I then completed the installation & it works just fine now. It loaded all of my personal data, such as bookmarks, it remembered my password, etc. It's fine for my needs, as I'm not a heavy user of special add-ons & plug-ins. Some of those may not work yet with the new version.

  • Help! I keep getting the following message: the procedure entry point sqlite3_wal_checkpoint could not be located in the dynamic link library SQLite3.dll.

    Hi,
    Since downloading the updated version of itunes around May this year I have had the following problems:
    1. This error message appears when my windows account launches:
    the procdure entry point sqlite3_wal_checkpoint could not be located in the dynamic link library SQLite3.dll.
    2. I can't play any of the files in my itunes library. An error message appears indicating it can't find the files.
    3. When I plugged my iphone in to update it was corrupted and I have lost all 7000 + songs.
    You can guess that I am not a very happy bunny with itunes at the moment!
    Please, can anyone suggest how to sort this lot out.  I am aware that I've probably lost the ipod songs, but I need to get rid of the error message and be able to play the songs on from my library.  I've been without since May now and I'm wondering whether to even bother getting it sorted, but I have quite a few albums purchased on itunes that I don't want to lose!
    Thank you for your time.
    Michelle

    Thank you.  I'm going to investigate saving my itunes library to the icloud and then re-trying the Stellar Phoenix recovery now the error messages have gone.  If the Stellar doesn't work then I will try the advice in your link. I really appreicate the help you've given me - at least I have my itunes library back! I'm kind of resigned to re-loading my CDs back on - something to keep my busy in the winter months!
    I'll let you know how I get on, but it will probably be a few days.I'm not very technical so I have to wait for my husband to get in from work to help me with this side of things.  He's been busy working on the Olympics, so I he hasn't had much spare time for a while!
    Michelle

  • I have tried to view videos created in premiere elements 10 and I get the following message: "this file type is not supported, or the required codec is  not installed.  When it opens there is a red screen in the monitor panel with Korean writing which als

    I have tried to view videos created in premiere elements 10 and I get the following message: "this file type is not supported, or the required codec is  not installed.  When it opens there is a red screen in the monitor panel with Korean writing which also appears in the place of each clip in the video.  I tried uninstalling and reinstalling premiere elements 10, but that did not have any effect on the video.  Do you have any suggestions?  I researched codec, but do not understand them at all.

    gloucester
    In case you did not find it, the following is a copy/paste of the Announcement on Premiere Elements 19/NVIDIA GeForce
    that appears at the top of this forum.
    Premiere Elements 10 NVIDIA Video Card Driver Roll Back
    If you are a Premiere Elements 10 user whose Windows computer uses a NVIDIA GeForce video card and you are experiencing
    Premiere Elements 10 display and/or unexplained program behavior, then your first line of troubleshooting needs to be rolling
    back the video card driver version instead of assuring that it is up to date.
    Since October 2013 to the present, there have been a growing number of reports about display and unexplained workflow
    glitches specific to the Premiere Elements 10 user whose Windows computer has a NVIDIA GeForce video card. If this applies
    to you, then the “user to user” remedy is to roll back the NVIDIA GeForce video card driver as far as is necessary to get rid of
    the problems. The typical driver roll back has gone back as far as March – July 2013 in order to get a working Premiere
    Elements 10. Neither NVIDIA nor Adobe has taken any corrective action in this regard to date, and none is expected moving forward.
    Since October 2013, the following thread has tried to keep up with the Premiere Elements 10 NVIDIA reports
    http://forums.adobe.com/thread/1317675
    Older NVIDIA GeForce drivers can be found
    http://www.nvidia.com/Download/Find.aspx?lang=en-us
    A February 2014 overview of the situation as well as how to use the older NVIDIA GeForce drivers for the driver roll back can be found
    http://atr935.blogspot.com/2014/02/pe10-nvidia-video-card-roll-back.html
    ATR

  • I can no longer start FF and am getting this error message in a pop up box: The procedure entry point XRE_FreeAppData could not be located in the dynamic link library xul.dll. How do I resolve?

    Please help

    Read Hi, just tried to upgrade to 11.2 but now when I try to open itunes I get an error message saying "the procedure entry point ADiAdID_acquirematchslotifnecessary could not be located in the dynamic link library iAdCore.dll". Any suggestions?

  • After installing a new version of Firefox, I get the error message "The procedure entry point JS_GetOperationLimit could not be located in the dynamic link library js3250.dll" when I try to start firefox. Elsewhere in the forum a complete reinstall is su

    After installing a new version of Firefox, I get the error message "The procedure entry point JS_GetOperationLimit could not be located in the dynamic link library js3250.dll" when I try to start firefox. Elsewhere in the forum a complete reinstall is suggested; however, I can't do that because of my company's IT policies. Is there any way to solve this problem WITHOUT a complete reinstall? Thank you!
    == This happened ==
    Every time Firefox opened
    == I installed a new version ==
    == User Agent ==
    Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; GTB6; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648)

    If you can't reinstall Firefox yourself then you need to contact your IT department and ask them to check the Firefox installation.
    It is possible that some files got broken with the latest update.

  • ITunes will no longer play my music, all the albumss are there but it if I click on a song to play it I get a message saying " The song (name of song) could not be played because the original file coul not be found. Would you like to locate it."

    iTunes will no longer play my music, all the albumss are there but it if I click on a song to play it I get a message saying " The song (name of song) could not be played because the original file coul not be found. Would you like to locate it."

    You get this message because  iTunes can’t find the file. This can happen for a number of reasons:
    The song file or a folder in its path was renamed
    The song file or the folder it is in has been moved
    The song file has been deleted
    The device containing the song files e.g. external drive is not accessible or the drive letter has changed.
    Do any of these aply to you?

  • My problem is on my Windows PC.  I am getting the error message, "The procedure entry point sqlite_3_wal_checkpoint could not be located in the dynamic link library SQLite3.dll.  I am told this is related to iTunes.  Any help?

    I use both a Mac and a PC.  My problem is on my Windows 7 PC.  I am getting the error message, "The procedure entry point sqlite_3_wal_checkpoint could not be located in the dynamic link library SQLite3.dll.  I am told this is related to iTunes.  Any help out there?  Thanks

    With Windows Explorer, navigate to your C:\Program Files\Common Files\Apple\Apple Application Support folder.
    Copy the SQLite3.dll that you should find there, navigate to the nearby Mobile Device Support folder, and Paste it in there also.
    Restart the programme all should be well
    In case that your OS is (64 bit)
    1. Open windows explorer, go to location C:\Program Files (x86)\Common Files\Apple\Apple Application Support
    2. Copy file "SQLite3.dll"
    3. Now paste it in the folder  C:\Program Files (x86)\Common Files\Apple\Mobile Device Support
    4. Restart the programme, it should not display that message, it should be clear.
    Good Luck

  • Using time warner road runner. when I try to open up safari to home page I get error message that this version does not support the "community toolbar" can't proceed until closing the error message. sick of seeing it

    using time warner road runner. when I try to open up safari to home page I get error message that this version does not support the "community toolbar" can't proceed until closing the error message. sick of seeing it

    That toolbar/ct plugin seems to cause problems for all who install it!
    Close Safari, then locate and delete the following files and it should be gone:
    /Library/Application Support/Conduit
    /Library/InputManagers/CTLoader
    /Library/Receipts/ctloader.pkg
    /Library/Receipts/<Toolbar name>.pkg
    /Library/Application Support/SIMBL/Plugins/CT2285220.bundle
    /Users/<User name>/Library/Application Support/Conduit
    where / is the root library on your Hard Disk.
    If you are running Snow Leopard you should also look here:
    Library/launchAgents/com.conduit.loader.agent.plist
    Library/Application support/conduit plugins
    Also, as mentioned by Gilli2000:
    Library/Receipts - If you read it, it has information in it at the bottom referring extensively to "CT" and "community toolbar".
    Maybe it is harmless, but trash those items anyway!
    Note: Safari does not support any third-party toolbars except those supplied as an extension to Safari via the Extension Gallery.

  • Why is it that every udate of my iPhone software do I get the error message on my laptop: AppleSyncNotifier.exe - Entry Point Not Found The procedure enrty point xmlTextReaderConstName could not be located in the dynamic link library libxml2.dll

    Each time I update the software on my iPhone4 I get the following error message on my lap top: AppleSyncNotifier.exe - Entry Point Not Found The procedure enrty point xmlTextReaderConstName could not be located in the dynamic link library libxml2.dll
    I go on line to find a solution, but it must be a common problem, why has apple not corrected yet?

    This is the fix I got from discussions and it worked for me.  It is copied below.  I just did the manual fix which I have underlined. Good luck! Regards, Belle.
    This can occur because libmxl2.dll is not in your C:\Program Files\Common Files\Apple\Mobile Device Support folder.
    There have been some issues with this and other dlls not being in the right place (or not being everywhere they should be) since the 10.3.1.55 iTunes update.
    However, I note that the 10.4 iTunes update is now out - surprisingly quickly - so try installing that, rebooting, and see if your issue is solved.
    If it isn't, though, here's the manual fix:-
    With Windows Explorer, navigate to your C:\Program Files\Common Files\Apple\Apple Application Support folder.
    Copy the libmxl2.dll that you should find there, navigate to the nearby Mobile Device Support folder, and Paste it in there also.
    Reboot and see if all is well.
    I actually had the issue with SQLite3.dll, and the above fix worked for me (I found it in an April 2010 posting!).
    I passed on the fix as above for the similar issue with libmxl2.dll to someone who had exactly your problem, and he reported that it fixed it for him.

Maybe you are looking for

  • JFrame and Windows as a whole

    Hey peoples, Anyone know where I can get information in regards to building custom windows? For example, the default Java Window has the Java Icon on the top right of the window and has a particular color to it. I was interested on making a window wi

  • Xz1 screen mirroring -no sound

    hello. I have xperia z1 firmware 14.2.a.1.136. the problem is- no sound when combined screen mirroring (no problem with image-I can see phone screen  in TV) I tried to reset the phone to factory settings / repair by PCC-Repair Phone; TV-samsung  UE55

  • Nls_database_parameters- nls_length_semantics Help!

    Hi all! I have to create a database with the parameter nls_length_semantics set to char but I don't know how to do it! In a new machine, where was installed only the oracle client(10), I install a new database software (10g), during the installation

  • Photoshop stops working after pc comes out of 'sleep mode'

    Hello, Photoshop stops working lately, when I start my pc out of 'sleep mode', I get the warning box 'Photoshop CC doesn't work anymore'. Is this a known problem, can I do something about that? Thanks in advance! These are my pc specs: -Windows 7, Pr

  • PSE 9 doesn't recognize my printer

    I have PSE 9 and Windows 7.  I printed several photos today and all of a sudden the program tells me I have to install the printer.  When I look at devices and printers, they are all showing up.  I printed a test page, and the test page works.  It's