1

I have looked up this question across the site, like this link.

I am currently using NodaTime.dll for my DateTime needs, and I am interested in keep using this. However, if the user I distribute my app to doesn't have NodaTime.dll in either their GAC or /Libraries/ folder, my app would fail to run (no necessary dependencies). I was contemplating distributing NodaTime.dll with my app, but it doesn't seem painless and/or intuitive enough on my user's end.

I was thinking, maybe if there is a way, on compile, I could consume the .dll, and my app could reference NodaTime.dll within itself.

I have so far compiled my application by also adding NodaTime.dll as an existing file, but doing so does not work as intended -- my app still references the NodaTime.dll in my /Libraries/ folder.

enter image description here

Community
  • 1
  • 1
theGreenCabbage
  • 5,197
  • 19
  • 79
  • 169

2 Answers2

0

Look into using Costura. It allows embedding of assemblies that are marked as CopyLocal True.

Joel Lucsy
  • 8,520
  • 1
  • 29
  • 35
0

ILMerge is what you need. This official Microsoft tool allows you to merge two assemblies into one. When developing, you reference the assembly. When distributing, first merge the two assemblies.

ILMerge download link: http://www.microsoft.com/en-us/download/details.aspx?id=17630

Jente Rosseel
  • 1,195
  • 1
  • 10
  • 18
  • Hmmm. For my needs, it seems like using ILMerge breaks my tool. I am currently creating Grasshopper 3D components. These components (it's a node-based programming language. Each "node" is called a component) are `.gha` extensions, which are just renamed `.dll`s. When I used ILMerge, it seemed to break the component. As per the definition of what "break" means, I'm not too sure -- it simply doesn't work. – theGreenCabbage Mar 20 '14 at 20:35