Skip to content
This repository has been archived by the owner on Mar 2, 2023. It is now read-only.

Dependency on Micrsoft.AspNet.WebApi.WebHost not always needed #18

Open
delpher opened this issue Oct 12, 2020 · 4 comments
Open

Dependency on Micrsoft.AspNet.WebApi.WebHost not always needed #18

delpher opened this issue Oct 12, 2020 · 4 comments
Assignees
Labels
Enhancement 🔨 Improvement of existing features

Comments

@delpher
Copy link

delpher commented Oct 12, 2020

UnityDependencyResolver can also be used with a self-hosting on OWIN
but this package has a dependency on Microsoft.AspNet.WebApi which in its turn
depends on Microsoft.AspNet.WebApi.WebHost.
UnityDependencyResolver, however, has no dependency on any particular hosting environment.
Please, consider extracting UnityDependencyResolver into a separate package.

@ENikS
Copy link
Contributor

ENikS commented Oct 12, 2020 via email

@delpher
Copy link
Author

delpher commented Oct 12, 2020

It could be addressed but it would help if you provide more context. I know very little about the subject.

Ok, let me create some sample project and I'll get back to you.

@delpher
Copy link
Author

delpher commented Oct 12, 2020

I have created Sample. This is a console app, that can be started on it's own without IIS.
In the Startup.cs class there is a registration of UnityDependencyResolver by setting it as DependencyResolver in HttpConfiguration.

When I install your package, it will add dependency to Microsoft.Aspnet.WebApi that depends on Microsoft.AspNet.WebApi.WebHost which is not needed to run this project. All necessary abstractions for UnityDependencyResolver can be found in Microsoft.AspNet.WebApi.Core package, which can be installed separately.

Therefore it would be nice, if you extract UnityDependecnyResolver
into separate package, that only depends upon Microsoft.AspNet.WebApi.Core. This way, this package can be used in a self-host projects, that don't run nor depend on web hosting platform such as IIS.

I've made this screenshot to illustrate dependency graph:
Screenshot

@ENikS
Copy link
Contributor

ENikS commented Oct 12, 2020 via email

@ENikS ENikS self-assigned this Oct 30, 2020
@ENikS ENikS added the Enhancement 🔨 Improvement of existing features label Oct 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Enhancement 🔨 Improvement of existing features
Projects
None yet
Development

No branches or pull requests

2 participants