title: Castle Windsor Ms Adaptor Core 2.0 Implementation
body: <p>Could someone expand upon the directions Halil Kalkan (@hikalkan) provided here: <a href="https://github.com/volosoft/castle-windsor-ms-adapter" rel="nofollow noreferrer">https://github.com/volosoft/castle-windsor-ms-adapter</a></p>
  
  <p>ORIGINAL - works using standard Microsoft DI</p>
  
  <pre><code>public void ConfigureServices(IServiceCollection services)
      {
          services.AddAutoMapper();
          services.AddMvc();
          services.AddApiVersioning();
  
          services.AddDbContextPool&lt;CIDMSContext&gt;(options =&gt; options.UseSqlServer(""));
          services.AddScoped&lt;IBuildingRepository, BuildingRepository&gt;();
          services.AddScoped&lt;IComponentRepository, ComponentRepository&gt;();
      }
  </code></pre>
  
  <p>NEW - does not work. trying to use Castle.Windsor.MsDependencyInjection</p>
  
  <pre><code>public IServiceProvider ConfigureServices(IServiceCollection services)
      {
          services.AddAutoMapper();
          services.AddMvc();
          services.AddApiVersioning();
  
          services.AddDbContextPool&lt;CIDMSContext&gt;(options =&gt; options.UseSqlServer(""));
          //services.AddScoped&lt;IBuildingRepository, BuildingRepository&gt;();
          //services.AddScoped&lt;IComponentRepository, ComponentRepository&gt;();
  
          return WindsorRegistrationHelper.CreateServiceProvider(
              new WindsorContainer(), services);
      }
  </code></pre>
  
  <p>I am getting the error:</p>
  
  <blockquote>
    <p>Unable to resolve service for type '...Repositories.Buildings.IBuildingRepository' while attempting to activate ...Controllers.BuildingController'</p>
  </blockquote>
  
  <p>My ultimate goal is to not have to DI every single repository that I ever create. I would like Castle Windsor to DI it by convention. If there are other options to doing this for .Net Core 2.0 then I am open to those options as well.</p>
  
  <p>I am using Visual Studio 15.4.1 .Net Core 2.0 API project.</p>
  
  <p>EDIT:
  <a href="https://github.com/castleproject/Windsor/blob/master/docs/aspnetcore-facility.md" rel="nofollow noreferrer">CastleWindsor - ASP.NET Core Facility</a></p>