Tutorial :Why should I add reference to DLL?



Question:

Strange and probably trivial problem. I have three projects in one solution (.NET 2.0, Visual Studio 2005, C#). The first one produces GenericService.dll which contains one abstract generic class called GenericService:

public abstract class GenericService< T > { }   

The second one is ServiceImplementation.dll which contains ServiceImplementation class which inherits GenericService:

public class ServiceImplementation : GenericService< SomeType > { }  

The third one is a windows application which uses the ServiceImplementation:

ServiceImplementation si = new ServiceImplementation();  

So ServiceImplementation project references GenericService project, and windows application project references the ServiceImplementation project. This windows application can't be compiled, it requires a reference to GenericService.

Why? How can I solve that?


Solution:1

Add a reference to GenericService....

Your application is already referencing ServiceImplementation, however, if it directly accesses any classes/methods within GenericService then it must have a direct reference.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »