PIAB CachingCallHandler out parameter

Topics: Building and extending application blocks, Enterprise Library Core, Policy Injection Application Block
Sep 5, 2007 at 6:41 PM
Edited Sep 5, 2007 at 7:31 PM
There is an error when using the PIAB + CachingCallHandler with methods with byref, or out, parameters. For example, a method with this signature will fail:

public virtual string[] Select(int pageIndex, int recordsPerPage, out int totalRecordCount)

The problem is the out parameter totalRecordCount. The first call will work successfully, but the second call, the call that is returning from the cache, will fail with:

IndexOutOfRangeException: Index was outside the bounds of the array.

" at System.Runtime.Remoting.Proxies.RealProxy.PropagateOutParameters(IMessage msg, Object[] outArgs, Object returnValue)\r\n at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)\r\n at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)\r\n at Simpler.Data.Orm.ITable`1.Select(Int32 pageIndex, Int32 recordsPerPage, Int32& totalRecordCount)\r\n at Simpler.Data.Orm.Example.Program.Main(String[] args) in F:\\Foster\\Development\\Source\\c#\\Simpler\\Examples\\Simpler.Data.Orm.Example\\Program.cs:line 35\r\n at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)\r\n at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)\r\n at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r\n at System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n at System.Threading.ThreadHelper.ThreadStart()"

I have tried to implement custom return values in the Invoke method in the CachingCallHandler, but have not had any success. The parameters look valid, but when they pass back through the PIAB, the error occurs.

Please forgive me if the solution to this is located elsewhere. I have not been able to find any information on this on codeplex.

I will also post this in the issue tracker.

Thanks,

Jesse Foster | jf26028