Dependency Injection not working

Posts   
 
    
Posts: 1268
Joined: 10-Mar-2006
# Posted on: 30-Oct-2011 23:54:02   

Is there any diagnostics for why the Auditing is not loaded? It is a web application, and I have the web.config section and specific assembly.

I can do an Assembly.Load("assembly"), just like your DI framework does just fine. However, it is not working and there are no reasons why - just silently does not work.

Worse yet, I have other web projects where it does work - I have reviewed them until blue in face, same LLBLGen version (3.1.11.907), same web.config settings, etc. Auditing code is in the DAL library, so assembly present, etc. Really need some sort of diagnostics from DI framework.

I can override the CreateAuditor() and everything works fine.

Any ideas or any super secret tracing settings for DI framework (I know you have thought about doing that in the past).

Thanks...

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 31-Oct-2011 08:34:40   

How do you set DI in the config file?

Posts: 1268
Joined: 10-Mar-2006
# Posted on: 31-Oct-2011 13:31:55   

Every which way but loose. Using fullName - I have tried just the name, or with version or whatever. Again, have other projects that work.....the name I specify ends up in an Assembly.Load("") call in the DI ....a manual check to see if that code works with the fullName I specify works....

Really hoping for some sort of diagnostics really, as I have tried everything I can think of (and I can make it work in other projects). Not sure if it is related to something else....

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 31-Oct-2011 14:15:57   

Could you please attach the Auditor class?

Posts: 1268
Joined: 10-Mar-2006
# Posted on: 31-Oct-2011 15:08:21   

Sure, but that seems all fine as I am actually assigning the auditor class through CreateAuditor() overload now....so the auditor class is all good.... I have the attribute at top, etc....

Again, I have tried everything....thanks.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 31-Oct-2011 15:37:40   

Could you attach a simple repro solution? So we can try to help you out.

Posts: 1268
Joined: 10-Mar-2006
# Posted on: 02-Nov-2011 15:51:57   

Well problem is it works in one and not another. Not sure if it is related to something else in the solution, some other setting.... Could take me days to reproduce (and of course hard to fix from your point of view without a repo!)

I assume there is no logging of anything in the DI? Otis threatened to add that in 3.0. Any chance of quickly shoving some logging so this can be quickly solved?

As of now, easiest thing for me is to just leave out DI and use the overload CreateAuditor, but would like to get it fixed for future stuff! simple_smile

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 02-Nov-2011 17:13:42   

You can start with the current solution to create the repro. Just start by removing excess files and code, till you reach to the Repro you can send to us.

Otherwise I would suggest you alter the source of the ORMSupport library and add the logging you need, build it and use it, to find out what's going wrong.

Posts: 1268
Joined: 10-Mar-2006
# Posted on: 02-Nov-2011 17:15:15   

Well, I had hoped for some insight or that the logging was in the DI now. I have it working and that solution will still take several hours and I already spent lots of time trying to figure it out.

Thanks for your ideas.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 02-Nov-2011 17:21:15   

So the DI is currently working?! Exactly, what did you do for it to work?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39908
Joined: 17-Aug-2003
# Posted on: 03-Nov-2011 10:47:58   

Tracing for DI is planned for v3.5

Frans Bouma | Lead developer LLBLGen Pro
Posts: 1268
Joined: 10-Mar-2006
# Posted on: 03-Nov-2011 15:52:20   

Thanks Otis....when 3.5 comes out I will trace this and find out what is up....will update thread when that happens!