[go: up one dir, main page]

Skip to content

Opti-Q/castle-windsor-ms-adapter

 
 

Repository files navigation

Castle Windsor ASP.NET Core / Microsoft.Extensions.DependencyInjection Adapter

This library is a Castle Windsor adapter for Microsoft.Extensions.DependencyInjection nuget package. It works for ASP.NET Core and other type of applications.

How To Use?

  1. Install Puget Package

Install-Package Castle.Windsor.MsDependencyInjection

  1. Change Startup Class For ASP.NET Core, open your Startup class and add these using statements:
using Castle.Windsor;
using Castle.Windsor.MsDependencyInjection;

Find ConfigureServices method:

public void ConfigureServices(IServiceCollection services)
{
    ...
}

Change it like that:

public IServiceProvider ConfigureServices(IServiceCollection services)
{
    ...

    return WindsorRegistrationHelper.CreateServiceProvider(new WindsorContainer(), services);
}

Changed return type from void to IServiceProvider and used WindsorRegistrationHelper.

License

MIT

About

Castle Windsor ASP.NET Core / Microsoft.Extensions.DependencyInjection Adapter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 98.1%
  • PowerShell 1.3%
  • Batchfile 0.6%