I'm writing a plug-in for another application through an API. The plug-ins are distributed a DLLs. Is it possible to embed other files in the DLL file like pdfs, images, chm help files etc... I want to be able to provide documentation with my plug-in but I'd still like to retain the ability to distribute the plug-in as a single file the user can just drag and drop onto the application to install.
DLL dependenciesWhen a program or a DLL uses a DLL function in another DLL, a dependency is created. The program is no longer self-contained, and the program may experience problems if the dependency is broken.
Add DLL As Embedded Resource First, add the DLL as Reference. Then, add the same DLL as file into the project. Right click the project's name > Add > Existing Item... The same DLL will exist twice in different folder in the project.
a .exe formatted file. Normally the code for a microcontroller or an embedded processor would be self-contained and stand-alone. A DLL is a shared library and to use it requires runtime intervention.
Sure, you can embed a resource in your DLL. Then at runtime you just do:
Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("com.stackoverflow.plugin.example.Foo.pdf");
This would give you a stream to the Foo.pdf
file embedded in your DLL. Pay attention to the fact that the resource name has to be scoped by the namespace of the type from which you're invoking the method.
Sure, just make them "Embedded Resource" in VS.NET (assuming you're using it). You can then read them via resource APIs or simply with Assembly.GetManifestResourceStream().
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With