I want to host my WCF service with Castle's WCF facility. And I know that 
when we host service inside a Windows Service using WCF facility Castle can 
resolve dependencies automatically. Thus we don't need to use Resolve 
method of the container manually. Lately a friend of mine advised me to use 
IIS activation when hosting WCF services, because of its automatic app pool 
recycles. And I am trying to do that now. But I am confused at some point. 
When I used Windows Service approach, I was able to register all components 
of my program in the On Start event of the service like this.

container.AddFacility<WcfFacility>(t => t.CloseTimeout = 
TimeSpan.FromMinutes(serviceTimeout));

container.Register(
                Component.For<IDummyService>().ImplementedBy<DummyService>()
                
.Interceptors(InterceptorReference.ForType<ExceptionInterceptor>()).First
                
.Interceptors(InterceptorReference.ForType<UnitOfWorkInterceptor>()).Last
                .LifeStyle.PerWcfOperation()
                .AsWcfService
                (
                //other service registration stuff
                )

By the way I am using net.tcp binding. How can I do something like this, 
when I go with WCF Service Application? Can I add a svc file into a ASP.NET 
project and add container registration code into the app start in 
Global.asax?

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/castle-project-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to