Security Error?

May 17, 2010 at 12:27 PM

I am tryng to obtain a list of mailing lists from my MailChimp account. (it is the first call in this process). the call is maded from an ASP page.

I am getting the error shown below. it seems to suggest that the error is related to so request to read/write a file on the server.. what file is it trying to read/write? it should be getting all the data form the MC web site.

can someone explain what is happeng and how I can get around this problem?




   API_Error = Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

   at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
   at System.Security.CodeAccessPermission.Demand()
   at System.IO.Directory.GetCurrentDirectory()
   at System.Reflection.Emit.AssemblyBuilderData..ctor(Assembly assembly, String strAssemblyName, AssemblyBuilderAccess access, String dir)
   at System.AppDomain.InternalDefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access, String dir, Evidence evidence, PermissionSet requiredPermissions, PermissionSet optionalPermissions, PermissionSet refusedPermissions, StackCrawlMark& stackMark, IEnumerable`1 unsafeAssemblyAttributes)
   at System.AppDomain.DefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access)
   at CookComputing.XmlRpc.XmlRpcProxyGen.BuildAssembly(Type itf, String assemblyName, String moduleName, String typeName)
   at CookComputing.XmlRpc.XmlRpcProxyGen.Create(Type itf)
   at CookComputing.XmlRpc.XmlRpcProxyGen.Create[T]()
   at PerceptiveMCAPI.apiXmlRpc.get_api() in C:\myProjects\Visual Studio 2008\PerceptiveMCAPI_CodePlex\PerceptiveMCAPI\trunk\Application\apiXmlRpc.cs:line 12
   at PerceptiveMCAPI.Methods.lists.ExecuteXmlRpc() in C:\myProjects\Visual Studio 2008\PerceptiveMCAPI_CodePlex\PerceptiveMCAPI\trunk\List\lists\lists.cs:line 51

May 17, 2010 at 1:35 PM
If you are saying that you are trying to use the .NET wrapper from a classic ASP page -- it won't work. The wrapper requires Asp.Net 3.5 or higher. If that's not the case, the failure appears to occur when it's trying to create the xml-rpc proxy -- try using serial access and see what happens then. Let me know. dbm
May 17, 2010 at 3:06 PM

Thank you for your quick reply

I am using ASP with .NET 3.5 so the failure must be when it's trying to create the xml-rpc proxy

I am not up to speed on the source code. what do you mean by "

m try using serial access" . what do i need to do to do that?

again thanks for your help

May 17, 2010 at 5:32 PM
Edited May 17, 2010 at 5:34 PM
Forgive me, but you keep saying ASP - not ASP.NET or ASPX pages which throws me off -- but I'll assume you are using Asp.Net v3.5 -- not that you have .NET 3.5 framework installed, but are using Classic ASP for the site. Anyway... The wrapper allows for doing either an xml-rpc request, or, using MailChimp's terminology, serial requests -- basically using an http POST or GET request (POST is default) To do a serial request, set the wrapper directives to something like ... input.api_AccessType = EnumValues.AccessType.Serial; input.api_OutputType = EnumValues.OutputType.JSON; where 'input' is whatever name you're using for the method Input class. The OutputType has to be JSON or XML for serial requests, although unless you want the raw response info you can ignore that data and just use the output.result field/class. Set these directives after you create the Input class and before creating the method instance passing the Input class into the constructor By doing that, the wrapper will construct & send the POST request for you when you do the xxx.Execute() -- just like the xml-rpc request.
May 18, 2010 at 1:25 PM

This worked!

Thank you very much

Jan 11, 2013 at 12:57 AM

I was having this same issues and couldn't figure it out after applying the settings above.

Turns out the application pool needed to be set to the Network Services account not the ApplicationPoolIdentity.

Thought I would post incase anyone else was having this issues.