natemcmaster / DotNetCorePlugins

.NET Core library for dynamically loading code
Apache License 2.0
1.59k stars 227 forks source link

[Question] Does hot reload work for aspnetcore plugins with service registration? #233

Closed NewHeight closed 2 years ago

NewHeight commented 2 years ago

Hi, I has a aspnetcore plugin with service registration into the ServiceCollection, does it has any method to re-register the service when the plugin reload?

natemcmaster commented 2 years ago

No such method or feature exists. The hot reload capability is pretty bare-bones and doesn't work with ASP.NET Core's dependency injection setup, which is immutable after the service container is initialized.

Hope that helps, Nate