I've looked at the link you posted but I don't get it :-) Should I
create the ServiceHost using the CreateService method ? If yes what
should be passed as the constructorStrin ??
If you could give me a small example, that would be very nice.
This is my class for setting up the services.
internal class ServiceManager
{
readonly List<ServiceHost> services = new List<ServiceHost>();
public void RunServices()
{
this.SpustSluzbu<Service1>();
this.SpustSluzbu<Service2>();
this.SpustSluzbu<Service3>();
}
public void CloseAllServices()
{
this.services.ForEach(host => host.Close());
}
private void RunService<T>()
{
ServiceHost service= new ServiceHost(typeof(T));
service.Open();
services.Add(sluzba);
}
}
Thank you in advance!!
> Hi Martin,
>
> You need to add an AutofacDependencyInjectionServiceBehaviour to the service
> when you create it. This can be done by hooking the Opening event as in:http://code.google.com/p/autofac/source/browse/trunk/src/Source/Autof...
>
> <http://code.google.com/p/autofac/source/browse/trunk/src/Source/Autof...>I
> haven't used Autofac in this scenario myself, there may be some rough edges
> here so please follow up if you encounter any trouble.
>
> Cheers,
> Nick
>
> On 2 May 2010 22:35, Martin Fabik <fabik.mar...@gmail.com> wrote:
>
>
>
>
>
> > I'd like to inject my WCF services using Autofac on server side. In
> > the wiki there is just an example with a service hosted in IIS, but my
> > services are hosted in a windows service. In the IIS example there is
> > a factory attribute, but there is no factory attribute on the service
> > element in the app.config. So I'm just curious where should I define
> > the factory attribute ?
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Autofac" group.
> > To post to this group, send email to aut...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/autofac?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups "Autofac" group.
> To post to this group, send email to aut...@googlegroups.com.
> To unsubscribe from this group, send email to autofac+u...@googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/autofac?hl=en.
--
You received this message because you are subscribed to the Google Groups "Autofac" group.
To post to this group, send email to aut...@googlegroups.com.
To unsubscribe from this group, send email to autofac+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/autofac?hl=en.
I've looked at the link you posted but I don't get it :-) Should I
create the ServiceHost using the CreateService method ? If yes what
should be passed as the constructorStrin ??
If you could give me a small example, that would be very nice.
This is my class for setting up the services.
internal class ServiceManager
{
readonly List<ServiceHost> services = new List<ServiceHost>();
public void RunServices()
{
this.SpustSluzbu<Service1>();
this.SpustSluzbu<Service2>();
this.SpustSluzbu<Service3>();
}
public void CloseAllServices()
{
this.services.ForEach(host => host.Close());
}
private void RunService<T>()
{
ServiceHost service= new ServiceHost(typeof(T));
service.Open();
services.Add(sluzba);
}
}
Thank you in advance!!
> Hi Martin,
>
> You need to add an AutofacDependencyInjectionServiceBehaviour to the service
> when you create it. This can be done by hooking the Opening event as in:http://code.google.com/p/autofac/source/browse/trunk/src/Source/Autof...
>
> <http://code.google.com/p/autofac/source/browse/trunk/src/Source/Autof...>I
> haven't used Autofac in this scenario myself, there may be some rough edges
> here so please follow up if you encounter any trouble.
>
> Cheers,
> Nick
>
> On 2 May 2010 22:35, Martin Fabik <fabik.mar...@gmail.com> wrote:
>
>
>
>
>
> > I'd like to inject my WCF services using Autofac on server side. In
> > the wiki there is just an example with a service hosted in IIS, but my
> > services are hosted in a windows service. In the IIS example there is
> > a factory attribute, but there is no factory attribute on the service
> > element in the app.config. So I'm just curious where should I define
> > the factory attribute ?
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Autofac" group.
> > To post to this group, send email to aut...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/autofac?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups "Autofac" group.
> To post to this group, send email to aut...@googlegroups.com.
> To unsubscribe from this group, send email to autofac+u...@googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/autofac?hl=en.
--
You received this message because you are subscribed to the Google Groups "Autofac" group.
To post to this group, send email to aut...@googlegroups.com.
To unsubscribe from this group, send email to autofac+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/autofac?hl=en.