Hack Forums
[.NET] Embed .dll To .exe - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] Embed .dll To .exe (/showthread.php?tid=5901627)



Embed .dll To .exe - L33TPr0xY - Oct 30, 2018

just finished a program and I would like to make it just one file so its easy to hand out and not have extra files just laying around. I made a program using a framework that needs a .dll to be in the same location as the .exe. Could someone help on how i can embed it to make it just 1 file?


I tried to use the (Package Manager Console) with "install-package costura.fody"
and that didn't seam to work then i tried (ilmerge) and that wasn't working also.

i was told about trying "LibZ" but have no clue on how to even use it

Made with: vb.NET

[Image: 4219b379026863e30822f9e8715d7061.jpg]


RE: Embed .dll To .exe - gigajew - Oct 30, 2018

Use ILMerge, here's the project website https://github.com/dotnet/ILMerge
For a GUI version search ILMergeGUI


RE: Embed .dll To .exe - L33TPr0xY - Oct 30, 2018

(Oct 30, 2018 06:14 PM)gigajew Wrote:  Use ILMerge

" i tried (ilmerge) and that wasn't working also."
i already tried that and it was not working


RE: Embed .dll To .exe - 0xBB - Oct 31, 2018

Use NuGet to install a package called Costura.Fody.
Setting it is on their git.
🤝


RE: Embed .dll To .exe - L33TPr0xY - Oct 31, 2018

(Oct 31, 2018 12:19 AM)ibennz Wrote:  Use NuGet to install a package called Costura.Fody.
Setting it is on their git.
🤝

I already have tried all that it’s even said in the post.
Nothing works


RE: Embed .dll To .exe - xHeaven - Oct 31, 2018

(Oct 31, 2018 03:14 AM)L33TPr0xY Wrote:  I already have tried all that it’s even said in the post.
Nothing works

What do you mean by "nothing works"? It should work, I'm using it as well. What's the problem exactly?


RE: Embed .dll To .exe - Vyxn - Oct 31, 2018

Why all those working suggestion doesn't work with you? What are you doing with them?


RE: Embed .dll To .exe - Nick (Name) - Nov 1, 2018

(Oct 31, 2018 03:14 AM)L33TPr0xY Wrote:  I already have tried all that it’s even said in the post.
Nothing works

Did you properly setup the configuration file for Fody in the project? You have to specify each assembly you want embedded into to main assembly.


RE: Embed .dll To .exe - sh@rp - Nov 1, 2018

VisualPlus libraries are strong signing.....  does costura take care about this while trying to merge...???


RE: Embed .dll To .exe - xHeaven - Nov 1, 2018

Check if your project file contains something like this (.vbproj):
Code
<Import Project="..\packages\Costura.Fody.3.1.4\build\Costura.Fody.props" Condition="Exists('..\packages\Costura.Fody.3.1.4\build\Costura.Fody.props')" />

AND you have a file named FodyWeavers.xml in your project folder (the one that contains the bin, Resources, Properties etc folders), that contains the following lines:
Code
<?xml version="1.0" encoding="utf-8" ?>
<Weavers>
 <Costura/>
</Weavers>


And post your Build window, we can help more if we can see more than "it doesn't work".


RE: Embed .dll To .exe - Anesthesia_Love - Nov 11, 2018

(Oct 30, 2018 05:20 PM)L33TPr0xY Wrote:  just finished a program and I would like to make it just one file so its easy to hand out and not have extra files just laying around. I made a program using a framework that needs a .dll to be in the same location as the .exe. Could someone help on how i can embed it to make it just 1 file?


I tried to use the (Package Manager Console) with "install-package costura.fody"
and that didn't seam to work then i tried (ilmerge) and that wasn't working also.

i was told about trying "LibZ" but have no clue on how to even use it

Made with: vb.NET

Can you pm your program im interested in it.


RE: Embed .dll To .exe - Profesorel - Nov 11, 2018

use Costura.Fody from nugget :D