Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Tuesday, August 29, 2006 1:57 PM
My code calls functions provided in an io.dll file. The problem is when I pass my exe file to others, I need to send this io.dll to them and ask them to put that in the same directory of .exe file.
Is there any way I can compile this .dll file into my code so that only one file is necessary to pass around?
Thanks.
All replies (9)
Tuesday, August 29, 2006 2:07 PM ✅Answered
Right click on the project name and then "Add Existing Item". Add the dll to your project and from the properties window set the "Build Action" property to "embedded resource"...
Tuesday, August 29, 2006 2:54 PM ✅Answered
What you're trying to accomplish is not an easy feat. If you got it to work (below) it would be largely considered hackish. Is there any reason why you can't ship the DLL as well?
As DMan has pointed out you could compile this assembly as an embedded resource. However on startup you would have to read the assembly out and write it to disk next to you EXE before you accessed any types from that assembly. I would strongly recomend against this.
Tuesday, August 29, 2006 3:14 PM ✅Answered
Have you considered using a setup project (or Click Once publishing) to install your app & dll? Then, all your user needs to do is double-click your setup (or click a link on a web page) to get everything where it needs to go.
--Matt--*
Tuesday, August 29, 2006 6:11 PM ✅Answered
You may have to manually include the dll in the click once manifest.
Right click on the project and choose properties.
Got to the Publish Tab
Click on Application files
Make sure the DLL is in the Download Group ,"Required"
Tuesday, August 29, 2006 2:36 PM
Yes. I found the "build action" now under the properties window of the dll file. Before I looked at the properties windows the project.
The problem is, the exe file still needs the dll to run properly. Am I missing something?
Thanks.
Tuesday, August 29, 2006 3:00 PM
Just feel a little trouble to ask users to put the dll into the same directory as the exe file.
Tuesday, August 29, 2006 4:50 PM
Yes. I tried clickonce publishing. It only installed the exe file. I still needs to copy the dll file manually. really annoying.
Tuesday, August 29, 2006 5:35 PM
Right-click setup project, view->file system; under "Application Folder", drag your .dll in there.
Wednesday, August 30, 2006 2:18 PM
Thank you guys all for the wonderful help.