Skip to content

Instantly share code, notes, and snippets.

@cammerman
Created February 7, 2011 03:30
Show Gist options
  • Select an option

  • Save cammerman/813961 to your computer and use it in GitHub Desktop.

Select an option

Save cammerman/813961 to your computer and use it in GitHub Desktop.
Service IoC bootstrapper, v2
using System.ServiceProcess;
using Autofac;
namespace HelloSvc
{
internal class ServiceBootstrapper
{
public IContainer Build()
{
var builder = new ContainerBuilder();
builder
.RegisterType<Services.GreetService>()
.As<ServiceBase>()
.InstancePerLifetimeScope();
return builder.Build();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment