Fix autobinding problem

This commit is contained in:
Antony Male 2014-02-25 13:15:45 +00:00
parent f41645ab89
commit 5f655188c5
1 changed files with 4 additions and 1 deletions

View File

@ -376,7 +376,10 @@ namespace StyletIoC
/// <param name="assemblies">Assembly(s) to search, or leave empty / null to search the current assembly</param>
public void Autobind(params Assembly[] assemblies)
{
this.Autobind(assemblies);
// Have to do null-or-empty check here as well, otherwise GetCallingAssembly returns this one....
if (assemblies == null || assemblies.Length == 0)
assemblies = new[] { Assembly.GetCallingAssembly() };
this.Autobind(assemblies.AsEnumerable());
}
/// <summary>