Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Referencing the Microsoft Enterprise Library DLL file in a wrapper DLL

I am writing an application using the Microsoft Enterprise Library. I wrote a wrapper DLL for that Enterprise Library DLL file. I want to use my wrapper in some Windows Forms application. The problem is that every time I want to use my wrapper I get an error in the compilation that says that a reference to the Enterprise Library DLL file is missing.

I can simply solve it by supplying this reference, but I think I am missing something here, because I just wrapped that Enterprise Library DLL file in my DLL. Why isn't the reference inherited from my wrapper project to the Windows Forms project?

As I understand the Windows Forms application searches the bin directory and then the GAC, and if it doesn't find the wanted DLL file, it raises an error.

The Microsoft Enterprise Library DLL file is already signed and in the GAC so what is the problem here? As I said I feel I am missing something!

like image 931
Omri Avatar asked Dec 17 '25 17:12

Omri


1 Answers

Assembly references are not transitive.

If you reference and call assembly A, which references assembly B, you don't automatically get a reference to assembly B. If your interaction with A requires types from B, you'll need to refer to B, too.

like image 100
Jay Bazuzi Avatar answered Dec 20 '25 07:12

Jay Bazuzi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!