-2

I have some code written in C# which uses an external DLL to run. I want to make that code run on another person's computer without installing it. I just want an exe that does all the work. Some programs have a portable version and have that behavior. How can I make a portable version of my code?

squillman
  • 13,363
  • 3
  • 41
  • 60

1 Answers1

0

You have to reference your dll and also add the .dll file in your project then mark it as Embedded Resource to not have to copy it on the destination PC. Here is an example :

https://www.codeproject.com/Articles/528178/Load-DLL-From-Embedded-Resource

If you don't want to relink the dll at each compilation (if the dll is your's), you can "Add existing file" then "Add as link" instead as "Add" (click on the arrow on the "Add" button) to add a link to your bin folder (of you dll project) instead of making a local copy of the dll.

KiwiJaune
  • 530
  • 2
  • 16