• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

.NET - Including dependencies

Slid

Member
Hey,

I've been working on a little program at work and it is nearing the finished stage but I am having a little issue including .dll files. I am making use of Shell32.dll but for some reason when I run the .exe it bombs out because it can't find the library. I don't want to make an installer for the program - I'd rather it be just one file, a done deal.

Is there any way to INCLUDE a .dll in the .exe itself? I know this would make the .exe a bit larger (but the included functions are only 54kb) but I want to do it anyways.

I can't seem to find any information on this.

Thanks!

Edit: Excuse me - when I say dependency I mean "Reference" 🙂

In my references box it calls my .dll "Interop.Shell32"
 
Okay - I've managed to include the .dll as an embedded resource by going to Project->Add Existing Item. It has increased my .exe filesize by 54kb 🙂 I thought I was the champion until I ran the program and got the same error. It is like .NET doesn't pay attention that the .dll is embedded. There must be some type of command to make it see it but I'm not quite sure what that is.

I am using VB .NET by the way.

Thanks in advance.
 
DLLs must be external to the EXE at the time they are loaded, only LIBs actually get linked into the EXE.

You could possibly make this work by including the DLL in the EXE, then extracting it at run time, but then you must also load the DLL explicitly with LoadLibrary, and bind to functions with GetProcAddress.
 
you're best bet would be to create a deploy project, it automatically includes dependencies, and if not you can add your own.
 
Back
Top