Fab wrote:
Just want to add some thoughts
I think it's dangerous to put this config mandatory in the config file to allow the DI to works and not offer a way to config it in code. I don't want to make this point configurable, the DI must always be activated as it allow some very important module to work : Concurrency check & Validation. If the config is missing for some reason (intentional or not) we can have data loss... without seeing it as the application will run without errors.
That's a side effect of having dependency injection based on a config file.
You can also use DependencyInjection scopes, which are local to a thread. To set these up, please consult the manual, and you can then do your DI configuration manually.
This was for my particular case, but let me make some generalisation...
Take an Client/Server application with Auditors and Authorizer developped to put some security. Do you think it's normal to allow the final user to disable these functionalities just by modifying the application config ? And so he'll have all permissions with audit disabled ?
I just talk about that because I know in the future I'll use these functionalities...
I understand what you're saying, but as I described above: there's no other way to do it. If you want to have code-driven DI, you can use dependency injection scopes.
besides that, if a user can alter the config file, you really think the app is then still 'secure'? The user can also run ildasm or reflector, change things and re-assemble it. Signed code doesn't help there, sn has a setting which disables signature checks.