1

Preface: I know basically nothing about C#. I've added a dll to my project. I have no build errors, but when I try to run, I get an error that says it can't find the dll. I've tried copying it to the output directories too. To no avail.

Any idea what could be happening?

Specific Error:

System.IO.FileNotFoundException was unhandled Message=Could not load file or assembly 'controllib_clr.dll' or one of its dependencies. The specified module could not be found. Source=controllib_demo_cs...

I'll be happy to add more information if need be. :) I just don't know what info would be beneficial given my (very) limited knowledge.

11
  • do you have "using" those libraries in your code behind ? Commented Dec 15, 2011 at 21:21
  • I do. It's called well before a function uses any classes from the dll. Commented Dec 15, 2011 at 21:22
  • Just want to confirm, did you add the assembly to your project by right-clicking the project name in Solution Explorer and clicking "Add Reference" and browsing for it (or some other similar method) or did you simply copy the .dll into your folder structure? Commented Dec 15, 2011 at 21:22
  • Have you tried setting on the properties "Local Copy" to true? Commented Dec 15, 2011 at 21:23
  • Yes, JOpukman. See comment below. I believe it's properly referenced. Commented Dec 15, 2011 at 21:23

3 Answers 3

3

It looks like it is not able to find/load some dependencies dlls I will use DependencyWalker to figure out what it is missing http://www.dependencywalker.com/

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

6 Comments

In my limited memory I thought the error was slightly different ... but looking at the dependencies is always a good idea.
Not totally sure, but I have two yellow question marks in the list at the bottom of the window: MSVCR90.dll and IESHIMS.dll. What say you?
This is new to me as well just searching, MSVCR90.dll is one of Visual studio dll and IESHIMS.dll is related to Internet Explorer.
Dependents are taken care of. Same problem.
|
0

Is it a managed (.NET) or an unmanaged (native) DLL? I'm assuming unmanaged.

FileNotFoundException is commonly thrown when missing a dependency. The DLL you are loading might require any number of other DLLs on load. In most cases it won't tell you which file it needs. You have to refer to the documentation for that DLL.

1 Comment

How do I find out what assembly it is?
0

If it exists, in your output folder, then most likely its one of its dependencies that is missing. You can fix this by adding its dependencies as references in your project.

if it doesn't exist in your output, then, check that "Copy Local" is set in the properties of the reference.

3 Comments

Well, it isn't being copied to the output folder and my output right now is an 'obj' folder, not 'bin'. So I'm assuming that the program isn't compiling completely.
when you look at the output window, is there anything interesting there indicating its doing something odd?
Doesn't look interesting... :/

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.