Reputation: 508
I have a Solution with 2 Projects...
Project A has Following A - Reference Third Party DLL (Which has a Class Called "Response") B - A Class which uses above DLL and returns the "Response" Object from a Method Called "GetResponse"
Now Project B Calls The Class From Project A Like This....
Response r = ProjectA.Class.GetResponse();
This will return a Error, because I dont have "Third party" reference in my project B.
I rather not ship my third party DLL to all of my other projects just to get the reference to Response Object from Third party DLL.
so is there anyway of doing it without having to add the 3rd party reference to Project B?
Upvotes: 3
Views: 1708
Reputation: 13907
If your project is using objects defined in the third party DLL, it has to be referenced directly as well.
If you want to avoid this, you can wrap the Response
object in a custom object defined in Project B, creating methods and properties to expose anything necessary on the Response
class. Remember, you can't expose the Response
class directly, or the direct reference will be necessary again.
Of course, even with wrapping, when deploying your final DLL, the third party DLL will still be required, it just won't need to be directly referenced.
Upvotes: 5