title: How do you call a managed (C#) function from C++?
body: <p>I have a C# DLL file project (<code>my_cs_dll.dll</code>) which defines a static class with a static member function.</p>
  <pre><code>namespace Foo
  {
      public static class Bar
      {
          public static double GetNumber() { return 1.0; }
      }
  }
  </code></pre>
  <p>I also have a C++ DLL project which is using <code>/clr</code>.</p>
  <pre><code>#using &lt;my_cs_dll.dll&gt;
  
  double get_number_from_cs() { return Foo::Bar::GetNumber(); }
  </code></pre>
  <p>I've added a reference to <code>'my_cs_dll.dll'</code> in the C++ project Common Properties references section (copy local/copy dependencies are both True).</p>
  <p>And I've also added the path to <code>'my_cs_dll.dll'</code> in the C++ project Configuration Properties C/C++ General 'Resolve#using References' section.</p>
  <p>Everything builds without error, however at runtime I keep getting a 'System.IO.FileNotFound' exception from the system claiming it can't find the <code>my_cs_dll.dll</code> assembly.</p>
  <p>Both DLL files are definitely present in the same directory from which I'm running.</p>
  <p>I have tried all sorts of variations on the settings mentioned above and read everything I could find on manged/unmanaged interop, but I can't seem to get my brain around what is wrong...</p>
  <p>I'm using Visual Studio 2008 and .NET 3.5.</p>