title: Error when calling a .net dll from Com Visible dll using javascript
body: <p>I am developing a windows 7 gadget.I am creating an activex object and loading the assembly.I am following the methodlogy mentioned here at <a href="http://www.codeproject.com/KB/gadgets/GadgetInterop.aspx" rel="nofollow noreferrer">codeproject</a> (GadgetInterop). One of the tasks of the gadget is to interface with Facebook.</p>
  
  <p>This is how I am referencing:
  Javascript creates a GadgetBuilder object.
  From here I load the my library. say "MyLibrary.dll". </p>
  
  <ul>
  <li>When I call method say MyLibrary.GetCount(), (just return some integer) it works.</li>
  <li>But when I call some facebook function inside the method say MyLibrary.GetFaceBookFeeds() it throws an error.I reference "facebook.dll" from <a href="http://facebooktoolkit.codeplex.com" rel="nofollow noreferrer">CodePlex</a></li>
  </ul>
  
  <p>If I test my code from a ASP.NET form it works perfectly. However, When I run it from my html page by trying to load it using javascript, I get the following error:</p>
  
  <blockquote>
    <p>Could not load file or assembly 'facebook, Version=2.1.3654.38113, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.</p>
  </blockquote>
  
  <p>I verified that the dll's are in the same folder as "MyLibrary.dll".</p>
  
  <ol>
  <li>Why is this error coming?</li>
  <li>How do I go about achieving my task? (I need to use calling a dll from javascript as we are doing a lot of other things in the dll).</li>
  </ol>