Skip to content

2 application parts with same controller (name) and runtime choosing 1 of them #4

@softyn

Description

@softyn

Hi,
I have 2 similar controllers as application parts in different dlls.
I would like to have ability to choose at runtime which of them to use.
Is it possible?
Currently I can register one of them at startup and later use it.
The problem is to replace that registred at startup dll with another one (so without restarting app).
I can load another dll, but the fist one gets somehow cached (?) and removing at runtime from builder.PartManager.ApplicationParts and replacing with new one
builder.AddApplicationPart(newAssembly).AddControllersAsServices() does not work for me.
(BTW. builder=services.AddMvc(); - from ConfigureServices stored in startup classs variable for futher usage).

Have you try such runtime Reaload scenario or have any ideas how to do it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions