0

I'm creating a basic class library that heavily wraps another DLL reference. I'm trying to build a DLL but it seems to not include the reference.

Is there a way I can build and package the my entire solution in a DLL along with the reference DLL?

Alvin Reyes
  • 710
  • 1
  • 8
  • 24
  • I assume you mean it isn't including the referenced assembly in the project output directory. Specify "Copy Local: True" in the reference properties in Visual Studio. – Dai Nov 10 '17 at 01:45
  • Do you want to embed the third party DLL in your DLL, or simply copy it to the output? Copying it to the output is as simple as ticking 'Copy Local' in the property panel of the references. For embedding, take a look [here](https://stackoverflow.com/questions/189549/embedding-dlls-in-a-compiled-executable) – Rob Nov 10 '17 at 01:45
  • Do you mean something specific when you say - `heavily wraps another DLL reference`? I believe you have a class library C# project in which you are referencing another *.dll file and trying to build the project from Visual Studio. Are you? – RBT Nov 10 '17 at 01:45
  • for embedding see https://stackoverflow.com/questions/96732/embedding-one-dll-inside-another-as-an-embedded-resource-and-then-calling-it-fro – Keith Nicholas Nov 10 '17 at 01:46
  • Yes. Basically the main app is a Java App. I use IKVM to convert that to a DLL and import that as a reference. I need to then create a C# Class Library that wraps that DLL. – Alvin Reyes Nov 10 '17 at 01:46

1 Answers1

0

I figured this out. I use ilmerge by microsoft (https://www.microsoft.com/en-us/download/details.aspx?id=17630) to merge my DLLs into a single DLL file.

Just go thru the following and you'll have the merged DLL.

Step 1: Install ilmerge and put it on your system classpath Step 2:

ilmerge /out:MergedDLLName.dll /closed DLL1.dll DLL2.dll DLL3.dll

Hope this helps.

Alvin Reyes
  • 710
  • 1
  • 8
  • 24