Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

No equivalent of AddControllersAsServices() for VC's and TagHelpers #4087

Closed
@dazinator

Description

@dazinator

If you have an external assembly, contianing a Controller, and a ViewComponent, you can register the controller with MVC by calling AddControllersAsServices()

However there is no equivalent for the ViewComponent.
The default behaviour seems to be if you have a project reference to the assembly then the VC is picked up, but if you don't have a project reference to it (i.e ILibraryManager is not aware of it) - because for example, it's a standalone "plugin" assembly, then VC's are not detected.

Could you add a method similar to AddControllersAsServices() but for VC's?

Or perhaps consider adding some sort of "IncludeMvcServicesFromAssemblies()` method, that will make sure the assemblies are treated as candidates for all types of services that MVC looks for - i.e Controllers, VC's, and whatever else.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions