title: C# DLLImport for C++ dll
body: <p>I have a .dll built in C++/CLI and .NET. Therefore, it is targeted to .NET applications. The API is a set of wrappers that uses managed types so it is NET native. I have imported the .dll and added a function like:</p>
  
  <pre><code>[DllImport(@"maplib.dll")]
  public static extern bool initialize(string a);
  </code></pre>
  
  <p>When I call this function in my C# code, it works fine, but if I want to add another function, like..</p>
  
  <pre><code>[DllImport(@"maplib.dll")]
  public static extern bool initialize(string a);
  public static extern bool runfile(string a, string b);
  </code></pre>
  
  <p>I get this error when I run my program. It is related to the second function:</p>
  
  <p>"Could not load type 'myapp.main' from assembly 'myapp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' because the method 'runfile' has no implementation (no RVA)."</p>
  
  <p>Why does this error occur and how can I fix it?</p>