FromExecutingAssembly and FromCallingAssembly are misleading. The naming suggests that it will use the assemblies from the perspective of where it is being called, but actually uses scrutor's perspective.
https://github.com/khellang/Scrutor/blob/master/src/Scrutor/TypeSourceSelector.cs#L20
public IImplementationTypeSelector FromCallingAssembly()
{
return FromAssemblies(Assembly.GetCallingAssembly());
}
public IImplementationTypeSelector FromExecutingAssembly()
{
return FromAssemblies(Assembly.GetExecutingAssembly());
}
Because these methods are defined in Scrutor, the resulting assemblies will be:
- FromCallingAssembly will use the assembly that called Scrutor, rather than the actual calling assembly.
- FromExecutingAssembly will use Scrutor's assembly. Always.
In other words,
scan.FromCallingAssembly === scan.FromAssemblies(Assembly.GetExecutingAssembly())
scan.FromExecutingAssembly === scan.FromAssemblies(typeof(Scrutor).Assembly)
FromExecutingAssemblyandFromCallingAssemblyare misleading. The naming suggests that it will use the assemblies from the perspective of where it is being called, but actually uses scrutor's perspective.https://github.com/khellang/Scrutor/blob/master/src/Scrutor/TypeSourceSelector.cs#L20
Because these methods are defined in Scrutor, the resulting assemblies will be:
In other words,
scan.FromCallingAssembly === scan.FromAssemblies(Assembly.GetExecutingAssembly())scan.FromExecutingAssembly === scan.FromAssemblies(typeof(Scrutor).Assembly)