Villermen
Villermen

Reputation: 824

Embed or reference project

In C#, I'm creating a library that depends on a few other libraries. I can import the source code of those libraries in my code, or I can leave them as is and reference the .dlls. Which practice is better, and which one is faster? So far as a (dis)advantage for keeping it as a .dll is that the end-user of my library is unable to get access to the libraries himself. But that's pretty much as far as I can get on this subject.

Gr.Viller

Upvotes: 2

Views: 127

Answers (2)

CodeTherapist
CodeTherapist

Reputation: 2806

If you include the extenal code, than you get (a little) performance boost. Because it's only one assembly to load. At the otherhand, updating this included code needs some effort.

When you want to benefit from both: try to use IL-Merge as post build action.

Upvotes: 1

Xaqron
Xaqron

Reputation: 30867

Reference them, so if a new version is released you don't need to compile your code again, just replace DLLs. Performance issue is neglectable and should not be considered.

Upvotes: 3

Related Questions