public ServiceLocatorAutoRegistrationManager(IServiceLocator serviceLocator)
{
Argument.IsNotNull("serviceLocator", serviceLocator);
_serviceLocator = serviceLocator;
if (EnvironmentHelper.IsProcessCurrentlyHostedByTool())
{
return;
}
TypeCache.AssemblyLoaded += (sender, args) =>
{
foreach (var type in args.LoadedTypes)
{
_pendingTypes.Enqueue(type);
}
if (_autoRegisterTypesViaAttributes)
{
try
{
InspectLoadedAssemblies();
}
catch (Exception ex)
{
Log.Error(ex, "Failed to handle dynamically loaded assembly '{0}'", args.Assembly.FullName);
}
}
};
}
#endregion