I'm a complete newbie when it comes to C# and Visual Studio. I have a reference with a path to a dll. It is pointing to an absolute directory and it works fine on my computer. However, when I send the exe to someone else to run, it fails to run because it can't find the dll. My guess is the path is hardcoded and the other person has the dll in another directory. I wanted to change the path to something else but the field is greyed out. What is the best approach to resolve this?
2 Answers
Set Copy Local (a property of the referenced dll) to true. When you compile your project, this will bring the dll into the compiled output directory.
2 Comments
You can add the reference to the solution project itself instead of writing a path to the DLL.
In your solution explorer look for your solution usually 'Solution - My Project' and then look for your current project and expand that option and where it says 'References' right click and do 'Add reference' and then find the DLL you want to reference.
When you compile your program it will then be linked in wth your debugger folder for when you release it.