Cannot load assembly MailChimpAPI

Nov 9, 2009 at 2:26 PM

Hey Everyone,

I'm trying to get a near identical version of the 'listBatchSubscribe' sample, and I'm getting an error saying it can't load an assembly.  Here's the error:

An error occurred creating the configuration section handler for MailChimpAPIconfig: Could not load file or assembly 'MailChimpAPI' or one of its dependencies. The system cannot find the file specified.

Code (bolded line is where exception is thrown):

public void ImportContacts()
{
listBatchSubscribeInput input = new listBatchSubscribeInput();
// directive overrides, because normally we do xml-rpc input.api_AccessType = EnumValues.AccessType.Serial; // access input.api_OutputType = EnumValues.OutputType.JSON; // output // method parameters input.apikey = MCAPISettings.default_apikey;

I've included both the PerceptiveMCAPI and Cook RPC dlls, and I've used the config from include pdf docs.  Does anyone have any suggestions?

Thanks in advance!

--J

Coordinator
Nov 9, 2009 at 6:24 PM

Hola Joel,

I haen't been able to reproduce this error -- can you give more info on your environment.

1) Which version of PerceptiveMCAPI are you using? -- v1.2.1 or v1.2.2 or custom compile?

2) Which version of the .NET framework are you running the application on?

3) Anything else you think might help....

 

Thanks,

David

Nov 9, 2009 at 6:43 PM

Hi David,

I'm using the latest stable version (1.2.1)--the binaries from the recommended downloads.  I'm running the app at .net 3.5 (with sp1).

Is there a MailChimpAPI.dll file that should be included with the app?  From what I read in the pdf, I needed to reference the MailChimp_v1_1.dll wrapper from MailChimp's website.  If MC's dll isn't needed, could it be causing a conflict somewhere?

Thanks,

--J

Coordinator
Nov 9, 2009 at 7:22 PM

The only files you need to add to the application are the PerceptiveMCAPI.dll & CookComputing.XmlRpcV2.dll files.

The only thing you need to reference is the -- PerceptiveMCAPI.dll -- IT references the -- CookComputing.XmlRpcV2.dll -- so you don't need to add that as a reference.

Assuming you're using a web app; right-click on the "References" folder, select Add Reference..., use the 'Browse' tab, find the folder containing  -- PerceptiveMCAPI.dll --, select the .dll and click OK -- that should do it.

Let me know how it goes.

David

Nov 18, 2009 at 7:15 PM

I'm having the same problem with the MailChimpAPI reference. There is no namespace found in the accompanying assemblies. I did find a settings class in the PerceptiveAPI dll but it doesn't have support for the attributes that I am adding in the config file. Any ideas??

Nov 18, 2009 at 8:05 PM

Ok here is what I was able to use to get mine working:

<configuration>
<
configSections>
<
section name="MailChimpAPIconfig" type="PerceptiveMCAPI.MCAPISettings, PerceptiveMCAPI" />
<
configSections>
<
MailChimpAPIconfig>
<MCAPI SecureAccess="False" Validate="False" apikey="[your api key here]" DataCenter="[your mailchimp data center]" OutputType="JSON" /> <!-- Available Output Types: NotSpecified, XmlRpc, XML, JSON, JSON_FMT, PHP -->
<
MailChimpAPIconfig>
<
configuration>

Dec 7, 2009 at 5:44 PM
spinon23 wrote:

Ok here is what I was able to use to get mine working:

<configuration>
<
configSections>
<
section name="MailChimpAPIconfig" type="PerceptiveMCAPI.MCAPISettings, PerceptiveMCAPI" />
<
configSections>
<
MailChimpAPIconfig>
<MCAPI SecureAccess="False" Validate="False" apikey="[your api key here]" DataCenter="[your mailchimp data center]" OutputType="JSON" /> <!-- Available Output Types: NotSpecified, XmlRpc, XML, JSON, JSON_FMT, PHP -->
<
MailChimpAPIconfig>
<
configuration>

Agreed, this is what I had to do as well to get it to work. Looks like the namespace of the published PerceptiveMCAPI.dll is different from that referenced in the documentation. In most cases, replacing "MailChimpAPI" namespace references with "PerceptiveMCAPI" does the trick.

Dec 7, 2009 at 5:47 PM

Perfect Guys!

I'm glad I wasn't the only one having the issue.  Thanks for all your help!

--J

Coordinator
Dec 7, 2009 at 7:49 PM

Yes, I did some namespace changing at one point and didn't change the documentation.

I missed seeing that when Joel reported it earlier. The dangers of seeing what you expect, not what's there.

I'll update it for the next publish.

Thanks to all.

David