This is when you have one class (DependsByProperty1) that takes a property dependency of a second type (DependsByProperty2), and the second type (DependsByProperty2) has a property dependency of the first type (DependsByProperty1).

If you have this situation, there are some important things to remember:

Make the property dependencies settable. The properties must be writeable.

Register the types usingPropertiesAutowired. Be sure to set the behavior to allow circular dependencies.

Neither type can be registered asInstancePerDependency. If either type is set to factory scope you won’t get the results you’re looking for (where the two types refer to each other). You can scope them however you like - SingleInstance, InstancePerLifetimeScope, or any other scope - just not factory.

This is when you have one class (DependsByCtor) that takes a constructor dependency of a second type (DependsByProperty), and the second type (DependsByProperty) has a property dependency of the first type (DependsByCtor).

If you have this situation, there are some important things to remember:

Make the property dependency settable. The property on the type with the property dependency must be writeable.

Register the type with the property dependency usingPropertiesAutowired. Be sure to set the behavior to allow circular dependencies.

Neither type can be registered asInstancePerDependency. If either type is set to factory scope you won’t get the results you’re looking for (where the two types refer to each other). You can scope them however you like - SingleInstance, InstancePerLifetimeScope, or any other scope - just not factory.