It's a latish ver 3.1, cloned early Feb. I'll try with a vanilla 3.2 ver 
and see if there's any difference.

On Saturday, 16 March 2013 02:14:31 UTC+1, Krzysztof Koźmic wrote:
>
> What version is that?
>
> It does look like a bug, feel free to add it to the issue tracker.
>
> I'm on holidays so I won't look into it before I come back.
>
> If someone else wants to have a look feel free
>
> Krzysztof Kozmic
> sent from my phone
> On 15 Mar 2013 16:31, "Robert Turner" <rob...@gmail.com <javascript:>> 
> wrote:
>
>> The following snippet reproduces the bug:
>>
>>         void FailingTest()
>>         {
>>             var proxyGen = new ProxyGenerator();
>>             var proxy = 
>> proxyGen.CreateInterfaceProxyWithoutTarget<ITest>(new 
>> SerializingInterceptor());
>>             
>>             var res = proxy.ATestMethod("an arg");
>>         }
>>
>>         public class SerializingInterceptor : IInterceptor
>>         {
>>             public void Intercept(IInvocation invocation)
>>             {
>>                 var stream = new MemoryStream();
>>                 var formatter = new BinaryFormatter();
>>                 try
>>                 {
>>                     formatter.Serialize(stream, invocation); // Dies here
>>                 }
>>                 catch (Exception e)
>>                 {
>>                 }
>>                 // Do something with stream...
>>             }
>>         }
>>
>>     public interface ITest
>>     {
>>         int ATestMethod(string str);
>>     }
>>
>>
>> Cheers for the support.
>> Rob
>>
>> On Friday, 15 March 2013 04:37:56 UTC+1, Krzysztof Koźmic wrote:
>>>
>>> Can you build a failing test that reproduces it?
>>>
>>> Krzysztof Kozmic
>>> sent from my phone
>>> On 15 Mar 2013 10:30, "Robert Turner" wrote:
>>>
>>>> Hi all,
>>>> I've got a DynamicProxy problem, but first the background of the 
>>>> problem is:
>>>> While we love Service Buses (SB) for passing messages around, for some 
>>>> applications it's desirable to have RPC-like functionality. Effectively 
>>>> achieving something close to WCF-like RPC but with the flexibility of a 
>>>> service bus.
>>>> We prefer the idea of using proxies to add RPC functionality to a 
>>>> service bus, rather than using an RPC framework (like WCF) as a service 
>>>> bus. We'd also put in other constraints like only allowing RPC async 
>>>> methods etc.
>>>> What we envisaged was to use target-less proxies (InterfaceNoTarget), 
>>>> send the IInvocation as part of a message via the service bus, and then 
>>>> invoke the target method.
>>>>
>>>> Now for the questions:
>>>> I've been having problems serializing IInvocation instances intercepted 
>>>> by DynamicProxy. Tracing through the code, when I try to serialize the 
>>>> IInvocation the AbstractInvocation GetObjectData method is called which 
>>>> creates an instance of RemoteInvocation. When RemoteInvocation is 
>>>> serialized it then also creates another instance of itself, causing an 
>>>> infinite loop. If let run it eventually breaks with a memory overflow 
>>>> exception.
>>>> Am I doing something fundamentally wrong here with DynamicProxy, or 
>>>> does our original application not make sense.
>>>>
>>>> Looking forward to responses.
>>>> Cheers,
>>>> Rob
>>>>  
>>>>   
>>>>
>>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Castle Project Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to castle-project-users+unsubscr...@googlegroups.com <javascript:>.
>> To post to this group, send email to 
>> castle-pro...@googlegroups.com<javascript:>
>> .
>> Visit this group at 
>> http://groups.google.com/group/castle-project-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to castle-project-users+unsubscr...@googlegroups.com.
To post to this group, send email to castle-project-users@googlegroups.com.
Visit this group at http://groups.google.com/group/castle-project-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to