If you are trying to register dependency by using a class that is using IServiceConfigurator, do not try to log message in the Configure method. It will throw a Read write locking error. Example
// Register the dependency using ServiceConfigurator
public class MyConfigurator : IServicesConfigurator
{
public void Configure(IServiceCollection serviceCollection)
{
//write
log.Info("I am doing things") <--- this will create the locking error
// Use a write lock to add the dependency
using (new WriteLockUsing())
{
serviceCollection.AddTransient<IMyDependency, MyDependency>();
}
}
}
Category: Information Technology