Hi Philip,
Is there any particular reason why IContainer.GetService<T>(bool) is not defined?
Because, SimpleContainer.GetService<T>(bool) does exist. Naturally, I would suspect that the (bool) overload should be present in IContainer too.
Please let me know if this is an inconsistency in the API.
Many thanks,
Brian
----------------------------------------------
Brian Chavez
Bit Armory, Inc.
http://www.bitarmory.com
Hi Philip,
Thanks for the explanation! That makes much more sense now! I guess the reason I asked is because I'm finding it difficult to debug the Simple.IoC because I keep running into a problem.
I have the following scenario:
Assembly A:
public interface IA
Assembly B:
[Impelements(typeof(IA), Lifecycle.Singleton)]
public class B : IA
Executing/Calling Assembly C:
public class C{
IContainer container = null;
.ctor(){
container = new SimpleContainer();
Loader loader = new Loader( container );
baseDir = AppDomain.CurrentDomain.BaseDirectory;
loader.LoadDirectory( baseDir, "AssemblyB.dll");
}
IA GetIAService(){
return container.GetService<IA>();
}
}
Now, if you notice, in C, I only load "AssemblyB.dll" in startup, but AssemblyB references a service interface in AssemblyA.dll.
I keep getting an exception like this:
{"Service type 'AssemblyA.IA' not found!"} System.Exception {Simple.IoC.ServiceNotFoundException}
I also get the same exception when I forcefully load AssemblyA.dll in C (even though it doesn't have any ImplementsAttributes).
Am I doing this right?
Many thanks!
Brian
----------------------------------------------
Brian Chavez
Bit Armory, Inc.
http://www.bitarmory.com
Thanks for the guidance Philip. After about 5 hours of debugging, I finally nailed it to a "service name" typo.
Thanks again,
-Brian
----------------------------------------------
Brian Chavez
Bit Armory, Inc.
http://www.bitarmory.com
From: linfufr...@googlegroups.com [mailto:linfufr...@googlegroups.com] On Behalf Of Philip Laureano
Sent: Wednesday, June 18, 2008 1:51 AM
To: linfufr...@googlegroups.com
Subject: Re: IContainer.GetService<T>(bool) missing?
Hi Brian,