title: adding a dll to c# project and using the dll functions
body: <p><a href="https://i.stack.imgur.com/inQHA.png" rel="nofollow noreferrer">enter image description here</a>I am trying to import a dll in my c# console project.
  I add the dll in the reference of the project. Right Click-&gt;add reference-&gt;browse.
  The DLL is placed in my project folder as well as in program data folder in c drive.</p>
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Runtime.InteropServices;
  using mcp2210;
  </code></pre>
  <p>the last line &quot;using mcp2210;&quot; gives an error</p>
  <blockquote>
  <p>Error 1 The type or namespace name 'mcp2210' could not be found (are
  you missing a using directive or an assembly
  reference?)   C:\Users\testuser\AppData\Local\Temporary
  Projects\ConsoleApplication1\Program.cs</p>
  </blockquote>
  <p>Do I need to use [DllImport(&quot;mcp2210.dll&quot;)] in my project?
  How can I access the functions of this dll?</p>
  <p><a href="https://i.stack.imgur.com/LY7ai.png" rel="nofollow noreferrer">Please see the images below</a></p>
  <h1>edit</h1>
  <p>Hi I was able to add the dll in my project using the namespace from the object browser. However when I try to run it in debug mode I get badImageFormatException was handled popup.</p>
  <p>Could not load file or assembly 'mcp2210_dll_m_dotnetv2_x86, Version=1.0.5980.19136, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.
  Why is this happening?</p>