title: Unable to import c++ dll to c# project using DllImport
body: <p>I'm trying to import a C++ Project Dll into a C# project. I found a lot of people talk about using DllImport. I tried using that and here is what I have-</p>
  
  <p><strong>CPP Code:</strong></p>
  
  <pre><code>int __declspec(dllexport) beginCode(double reportId);
  </code></pre>
  
  <p><strong>C# Code:</strong></p>
  
  <pre><code>[DllImport("C:\\Users\\&lt;my_user_id&gt;\\Desktop\\ctxmix\\Release\\ctxmix.dll",CallingConvention =CallingConvention.Cdecl ,CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
  public static extern int beginCode(double reportId);
  int result = beginCode(reportId);
  </code></pre>
  
  <p>But when I run, I'm getting an exception - Exception thrown:</p>
  
  <blockquote>
    <p>System.DllNotFoundException</p>
  </blockquote>
  
  <p>Do I have to add any references for the CPP Dll in the project or do anything else apart from the code which I have on the top? </p>
  
  <p>Edit: I'm trying to run my .exe using VS2015 and I get this exception on my local machine. Also, I don't see my CPP Dll in the Project->References section where as I see other references there.</p>