Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split hosting extensions from Castle.Windsor.Extensions.DependencyInjection into separate package #625

Closed
ikkentim opened this issue Sep 1, 2022 · 7 comments · Fixed by #628
Milestone

Comments

@ikkentim
Copy link
Contributor

ikkentim commented Sep 1, 2022

Castle.Windsor.Extensions.DependencyInjection contains a dependency to hosting related packages (Microsoft.Extensions.Hosting). You however don't always need hosting when using Microsoft.Extensions.DependencyInjection.Abstractions. It would be great if the hosting related functions could be split off into a Castle.Windsor.Extensions.Hosting package.

For example, I'm working on implementing Windsor for a front-end application which uses Microsofts DI abstractions. I'd prefer not to have hosting related dependencies in my front-end application.

#624 would reduce the pain, but the change suggested in this issue would be much better.

@jonorossi
Copy link
Member

Do you know how much code uses the Hosting package? I always wondered if it was just a little bit of code that could be provided as an example.

@ikkentim
Copy link
Contributor Author

ikkentim commented Sep 1, 2022

As far as I can see only this code:
https://github.com/castleproject/Windsor/blob/master/src/Castle.Windsor.Extensions.DependencyInjection/Extensions/HostBuilderExtensions.cs

These are nice-to-have extension methods for easily configuring Windsor on a HostBuilder.

You'd use it like this:

builder.UseWindsorContainerServiceProvider(myWindsorContainer);

// without HostBuilderExtensions:
builder.UseServiceProviderFactory<IWindsorContainer>(new WindsorServiceProviderFactory(myWindsorContainer));

@jonorossi
Copy link
Member

Looks like Autofac has a separate package for it. We'd keep it in the same repo here.

https://github.com/autofac/Autofac.Extensions.Hosting

@jonorossi
Copy link
Member

v6.0 has not yet been released if you wanted to get the change in before it goes out.

@ikkentim
Copy link
Contributor Author

ikkentim commented Sep 7, 2022

I'll see if I can get create a PR for this next week

@ikkentim
Copy link
Contributor Author

I've created a PR for this.

@jonorossi jonorossi added this to the v6.0.0 milestone Sep 29, 2022
@jonorossi
Copy link
Member

Thanks @ikkentim, sorry for the silence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants