Registering a type with multiple constructors and string dependency in Simple Injector
There are two things about your class that prevents Simple Injector from being able to auto-wire your DAL class:
- Your class has two constructors and
- If you remove the default constructor, primitive types such as strings can't be injected.
Nemesv is almost right in his comment. You can fallback to using a delegate registration like this:
container.Register<IDAL>(() => new DAL("db"));
This article describes why your application components should have only one constructor.