0

this might be a bit of a noob question..

I've coded a simple file conversion app in C Sharp (.net 4, VS2010) that uses the Filehelpers library. I've got a reference to the library in my project references. When I publish the project in Release mode, it outputs the Filehelpers.dll file with the executable together, and the executable won't work unless it's in the same folder as the DLL.

I tried setting Copy Local to False, but it still doesn't work. Is there any way to package the library as part of the exe file?? This is a very simple app which is meant to be distributed easily and having this required Dll floating around is a huge downside.

thanks T


Got it working after some fiddling with ILmerge not running on .net v4. Here is my command for future thread visitors:

ILMerge /targetplatform:v4,C:\windows\microsoft.net\framework\v4.0.30319 /out:merged.exe /log Original.exe FileHelepers.dll
Totomobile
  • 663
  • 2
  • 8
  • 19
  • 2
    http://stackoverflow.com/questions/753292/including-dlls-in-the-exe – Bob G Jul 21 '11 at 17:53
  • Are you asking if a third-party library can be combined into your project? – Security Hound Jul 21 '11 at 17:55
  • I am confused: are you trying to output the dll to a particular directory or is the .exe in the wrong place, or do you want to eliminate the .dll altogether from the final release somehow? – gangelo Jul 21 '11 at 17:55
  • Yes I was looking for a way to package the DLL files into the exe file. I thought there would be a setting somewhere I can switch to accomplish this but I will try ILMerge to see if I can accomplish the same thing. – Totomobile Jul 21 '11 at 17:57
  • I actually suggest: http://blogs.msdn.com/b/microsoft_press/archive/2010/02/03/jeffrey-richter-excerpt-2-from-clr-via-c-third-edition.aspx?PageIndex=2#comments instead of ILMerge. – Security Hound Jul 21 '11 at 18:36

1 Answers1

1

You may want to look in to your project property settings where you can custom copy files where ever you want post build if you are looking to move files around after the build. If you are looking to include a .dll in your .exe look here

Community
  • 1
  • 1
gangelo
  • 3,034
  • 4
  • 29
  • 43
  • He's not looking to copy the dll, he's looking to merge it into his exe. – Bob G Jul 21 '11 at 17:52
  • @Dark - well you speak good alien then; I should not have answered until someone else translated what he was trying to say. – gangelo Jul 21 '11 at 17:58
  • 1
    I thought it was pretty clear. The only actual question I asked was "Is there any way to package the library as part of the exe file" but my extra descriptions seemed to only confuse people.. – Totomobile Jul 21 '11 at 18:02