Using the V2 API wrapper for C#. I am getting the following while doing AddContact...
Method not found: 'System.Collections.Generic.List`1<CTCT.Components.Contacts.EmailAddress> CTCT.Components.Contacts.Contact.get_EmailAddresses()'.
at BusinessLayer.CCContact.Insert(DataRow dr, String format, Boolean ActionByCustomer)
at BusinessLayer.Syncronizer.SyncEmailSubscriptions.UpdateNewAndChangedContactsFrommeMembersweb() in c:\MembersWeb\enews\SyncContacts\BusinessLayer\SyncScriptBase.cs:line 166
There is no such method (get_EmailAddresses()) in either our code or in the C# wrapper for V2 APIs. Therefore, this message must be coming from your server. I can't be absolutely positive that this is happening on an AddContact call because the stack trace is missing a level. I don't understand why that is the case either. Perhaps a .pdb file is not up to date. In any case, Please explain why you believe we are getting this message.
Solved! Go to Solution.
Elijah it turns out this was my mistake. I had rebuilt the wrapper code but didn't bother to replace the previous CTCT.dll with the rebuilt version. It didn't occur to me that there would be hard coded links to methods and other attributes which is the only way that I can explain to myself how this could happen. Replacing the rebuilt dll with the previous version seems to have fixed the problem. Thanks always for your help.
Hello,
The method that you are seeing is the auto-generated get method for the EmailAddresses property of the Contact class. When you specify a property that has a get/set method, the actual method names are auto-generated as get_PropertyName and set_PropertyName. In this case, it seems that a location of your code is attempting to read the EmailAddresses property of the Contact object and is not able to find the get method. I would likely need to see the code more closely, but you should be able to dig a bit deeper by looking for code where you read the EmailAddresses property of a Contact object.
Another notable possibility is that there could be an issue where the binary DLL that's being used for the Constant Contact .NET SDK may be corrupted. You could try a very simple step of re-compiling the SDK to a DLL and using the new DLL. IF you recently updated the DLL, there were some updated to the SDK that could have caused this issue. It may be needed to recompile the application while referencing the new DLL.
If I can provide any more information or if we can review any additional information, please let me know!
Sincerely,
Elijah it turns out this was my mistake. I had rebuilt the wrapper code but didn't bother to replace the previous CTCT.dll with the rebuilt version. It didn't occur to me that there would be hard coded links to methods and other attributes which is the only way that I can explain to myself how this could happen. Replacing the rebuilt dll with the previous version seems to have fixed the problem. Thanks always for your help.
Announcements
Join our list to be notified of new features and updates to our V3 API.
Sign Up