The Type DefaultConventionScanner must be Convertible to ITypeScanner, StructureMap
I've tried googling this in many ways and somehow this is the first generic seeming error message I haven't been able to find ANY results for.
Anyway, I'm upgrading my StructureMap to the newest version (I'm not sure what the last one I had installed was I'm afraid) and I keep getting the error: Error 1 The type 'StructureMap.Graph.DefaultConventionScanner' cannot be used as type parameter 'T' in the generic type or method 'StructureMap.Graph.IAssemblyScanner.With<T>()'. There is no implicit reference conversion from 'StructureMap.Graph.DefaultConventionScanner' to 'StructureMap.Graph.ITypeScanner'.
.
The code that's causing the problem is:
Scan(scanner =>
{
scanner.Assembly(typeof(PersonService).Assembly);
scanner.AddAllTypesOf(typeof(IEntityService<>));
scanner开发者_如何转开发.AddAllTypesOf(typeof(IRootEntityService<>));
scanner.With<DefaultConventionScanner>(); // This line
});
Anyone have any ideas / experience with this sort of problem?
Worked it out now, it should be replaced with scanner.WithDefaultConventions()
;
精彩评论