While I haven't used your approach to dynamically register the interface 
implementations in an assembly you are right in that 
 Lifestyle.PerWcfOperation == InstanceContextMode.PerCall  

The default for Castle is for everything to be a singleton so I think 
that's what you are encountering.

Ma I suggest you manually register each service contract and implementation 
via a direct assembly reference in your Castle Windsor installer?

When you get this to work then you can try to dynamically load them and 
register.  Crawl , Walk then Run!  

Paul

On Monday, April 20, 2015 at 7:40:22 AM UTC-7, rioka wrote:
>
> I've just verified that, using my code, InstanceContextMode is set to 
> PerSession and ConcurrencyMode is set to Single, so I'm probably 
> registering the services the wrong way... :(
>
> Il giorno lunedì 20 aprile 2015 16:22:06 UTC+2, rioka ha scritto:
>>
>> I'd like to integrate Castle Windsor into a set of existing Wcf services.
>>
>> I've started with some sample services, and step by step added
>>
>> The official documentation states
>>
>> *If you are switching from WCF activation to Windsor's WcfFacility, 
>> please make sure to remove the ServiceBehavior attribute from service type.*
>>
>> So I've removed it from my sample services, and registered the services 
>> with this code
>>
>>  var filter = new 
>> AssemblyFilter(Assembly.GetExecutingAssembly().GetDirectory());
>>  var descriptors = Classes.FromAssemblyInDirectory(filter)
>>                           .Where(t => t.GetInterfaces()
>>                                        .Any(i => 
>> i.GetCustomAttributes<ServiceContractAttribute>().Any()));
>>  var serviceDescriptors = descriptors.WithService;
>>  container.Register(serviceDescriptors
>>           .DefaultInterfaces() 
>>           .LifestylePerWcfOperation());
>>
>> (GetDirectory is an extension method)
>>
>> This code works, and, if I've understood correctly the docs, calling 
>> LifestylePerWcfOperation I should get the same behavior 
>> as InstanceContextMode.PerCall
>>
>> Is this correct?
>>
>> As a second point, how could I set ConcurrencyMode instead?
>>
>> TIA
>>
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to