In this blog, I will explain how you can refer external dll in your SharePoint solution to make it work wherever this dll is not there in the Global Assembly Cache. So the solution itself must contain the dll. To add dll into your SharePoint solution below are the steps:
- Reference the dll in the Solution references first.
- Now add the dll into your solution by selecting the dll. Once you add it, it will appear in the References list. But it will not be added to the package of Solution, which we have to manually do that.
- Open package file
- Open Advanced Click Add > Add Existing Assembly
- Select dll source path. Now click OK. Make sure Deployment Target is
Once you are done with above steps. Now verify that WSP is containing that dll.
In my case I have renamed it from EmbedExternalDLLs.wsp file to EmbedExternalDLLs.cab and extract it to the folder. In that folder you will find that added dll.