I made a c# dll.but if the user want to use it in c# winforms he/she must have dll file in the exe folder.
how can i do something with dll project that it automatically add dll to exe file when used in other winforms app?
is it possible?
sorry if my english is not good
tnx
Asked
Active
Viewed 4,415 times
4

Ali mohammadi
- 49
- 1
- 5
-
Set the [copy local](http://msdn.microsoft.com/en-us/library/vstudio/t1zz5y8c%28v=vs.100%29.aspx) property to true – huMpty duMpty Dec 19 '13 at 10:13
-
What exactly do you want to do with this DLL? It's possible to load a DLL via Assembly.LoadFrom( ) – Liath Dec 19 '13 at 10:13
-
Don't think it's possible to do with the DLL, it would require either placing the DLL inside the GAC, or how you build your WinForm. – Nunners Dec 19 '13 at 10:14
3 Answers
2
there are many ways. here is a full guide:
http://msdn.microsoft.com/en-us/library/yx7xezcf(v=vs.110).aspx
I love this way to do this in code personally:
How to add folder to assembly search path at runtime in .NET?
0
You can save the dll in the Global Assembly cache.
Then you can refer to it in the application without needing it to be in the same folder.

Haedrian
- 4,240
- 2
- 32
- 53
0
I think what you are getting at is the programmer wants to use a DLL you have provided, but does not want the DLL to be inside the same folder as the EXE file when compiled.
try this:
Embedding DLLs in a compiled executable
Yoy can embed / include DLL files inside the exe file
The key words here is Embedded DLL

Community
- 1
- 1

davethecoder
- 3,856
- 4
- 35
- 66