Link to dll in c #

When I reference a dll in C #, I have my local path. So when I run it on another computer, it cannot find it. How can I add the dll so that it doesn't look in my local folder?

When I run my program on another machine, it says "Unable to find namespace, is there a directive or assembly reference missing?"

I have to search for the wrong keywords because I couldn't find anything.

+3


source to share


2 answers


Right-click on it in the Links area, go to properties and set Copy Local to True. This will copy the dll to your / bin output folder for distribution and should resolve the dependency on the machine without the DLL.



+10


source


An assembly reference has no path (local or otherwise). Assembly references only. You can test it yourself with ildasm and double click the assembly manifest.



The corresponding assembly must be available on another machine. Either in the same directory, or in the search path, or in the GAC. This is your deployment program (script, setup, etc.) which should ensure that all dependency is deployed on the client machine.

+1


source







All Articles