0

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 2

0

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.

Sign up to request clarification or add additional context in comments.

2 Comments

This is a dll from a third party that I may or may not be licensed to include. So what I was going to do was to ask users to install the third party program themselves to avoid the whole potential legal situation.
They would then need to register that dll in the GAC (see msdn.microsoft.com/en-us/library/ex0ss12c.aspx). If it's a dll that you have permission to use then you should be fine to distribute. If yu don't have permission to use it then I don't think the user installing it themselves make any difference.
0

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.

1 Comment

This is a dll from a third party that I may or may not be licensed to include. So what I was going to do was to ask users to install the third party program themselves to avoid the whole potential legal situation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.