1

Resolved

InputHelper.ofDict error

description

Using the latest source and doing something like e.g.
 
var content = new Campaign.Content.Template();
content.Sections["std_content00"] = "Hello, testing";
_api.CampaignUpdate(campaignID, "content", content); // _api is an MCApi
 
I get this exception
 
System.InvalidCastException: Specified cast is not valid.
at Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicFunctions.UnboxGeneric[T](Object source)
at Microsoft.FSharp.Collections.SeqModule.Iterate[T](FSharpFunc2 action, IEnumerable1 source)
at MailChimp.Types.InputHelper.ofDict(FSharpFunc2 keyf, IDictionary xd) in [...]\MailChimp\Common.fs:line 166
at MailChimp.Types.InputModule.ofDict(FSharpFunc
2 keyf, IDictionary xd) in [...]\MailChimp\Common.fs:line 225
at MailChimp.Types.Campaign.Content.Template.MailChimp-Types-IInput-ToInput() in [...]\MailChimp\MCTypes.fs:line 1340
at MailChimp.Types.InputHelper.|S|O|(Object x) in[...]\MailChimp\Common.fs:line 179
at MailChimp.Types.InputHelper.getValue(Object v) in [...]\MailChimp\Common.fs:line 191
at MailChimp.Types.InputModule.aux@236-1.GenerateNext(IEnumerable`1& next) in [...]\MailChimp\Common.fs:line 238
at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase1.MoveNextImpl()
at Microsoft.FSharp.Collections.SeqModule.ToArray[T](IEnumerable
1 source)
at MailChimp.Types.InputHelper.join(String delim, IEnumerable1 xs) in [...]\MailChimp\Common.fs:line 140
at MailChimp.Types.InputModule.aux@236.Invoke(String ko, IDictionary xs) in [...]\MailChimp\Common.fs:line 236
at MailChimp.Types.InputModule.buildQueryString@244-1.Invoke(Input arg10) in [...]\MailChimp\Common.fs:line 244
at MailChimp.Types.InputModule.buildQueryString(Input x) in [...]\MailChimp\Common.fs:line 244
at MailChimp.MCApiModule.callServerRaw(MCApi m, String name, Opt
1 p) in [...]\MailChimp\MCApi.fs:line 77
at MailChimp.MCApiModule.callServer[T](MCApi m, String name, Opt`1 p) in [...]\MailChimp\MCApi.fs:line 101
at MailChimp.MCApiModule.Campaign.update[a](MCApi m, String campaignID, String name, a value) in [...]\MailChimp\MCApi.fs:line 517
at MailChimp.MCApi.CampaignUpdate[b](String campaignID, String name, b value) in [...]\MailChimp\MCApi.fs:line 1026
...
 
I'm not smart enough to see which cast is failing, but if I revert to using the older ofDict function it works again

comments