title: not supported by the language
body: <p>I code regularly in C++, and for the specific project I'm working on right now, I'm writing a C++ lib whose methods are to be used in a C# lib, whose methods are to be used in a C# app.</p>
  
  <p>I use Microsoft Visual Studio 2017 on Windows 10. </p>
  
  <p>I created a solution with 3 projects : </p>
  
  <ol>
  <li>A C++/CLI dynamic lib (<code>New Project =&gt; Visual C++ =&gt; CLR =&gt; Class Library</code>)</li>
  <li>A C# lib (<code>New Project =&gt; Windows Classic Desktop =&gt; Class Library (.NET Framework)</code>)</li>
  <li>And a C# app (<code>New Project =&gt; Windows Classic Desktop =&gt; Console App (.NET Framework)</code>)</li>
  </ol>
  
  <p>For now, I'm just trying to make the 3 projects communicate together, and I seem to have problems between the C++ lib and the C# lib.</p>
  
  <p>The code in my C++ lib is the following ;</p>
  
  <p><strong>cppLib.h</strong></p>
  
  <pre><code>#pragma once
  #include &lt;string&gt;
  
  using std::string;
  
  using namespace System;
  
  namespace cppLib {
      public ref class cppClass
      {
      public:
          static string test();
          static double add(double arg1, double arg2);
      };
  }
  </code></pre>
  
  <p><strong>cppLib.cpp</strong></p>
  
  <pre><code>#include "cppLib.h"
  
  namespace cppLib {
      string cppClass::test() {
          return "Hello World from C++ lib.";
      }
  
      double cppClass::add(double arg1, double arg2) {
          return arg1 + arg2;
      }
  }
  </code></pre>
  
  <p>The code in my C# lib is the following :</p>
  
  <p><strong>Wrapper.cs</strong></p>
  
  <pre><code>using cppLib;
  
  namespace CsWrapper
  {
      public class Wrapper
      {
          //static public string TestCppLib()
          //{
          //    return cppClass.test();
          //}
  
          static public double Add(double arg1, double arg2)
          {
              return cppClass.add(arg1, arg2);
          }
  
          public string WrapperTest()
          {
              return "Hello World from C# lib.";
          }
      }
  }
  </code></pre>
  
  <p>As is, this code builds without errors nor warnings. So I can call my <code>static double add(double arg1, double arg2);</code> method from my C++ lib in my C# lib method <code>static public double Add(double arg1, double arg2)</code>, BUT if I try to uncomment the following code in <strong>Wrapper.cs</strong> :</p>
  
  <pre><code>        //static public string TestCppLib()
          //{
          //    return cppClass.test();
          //}
  </code></pre>
  
  <p>I get the <code>'cppClass.test(?)' is not supported by the language</code> error message :</p>
  
  <pre><code>Severity    Code        Description                                             Project     File                                        Suppression State
  Error       CS0570      'cppClass.test(?)' is not supported by the language     CsWrapper   D:\documents\...\CsWrapper\Wrapper.cs       Active
  </code></pre>
  
  <p>What does it mean? How can I call one method from my C++ lib in my C# lib without problem, but the other I can't? My <code>public string WrapperTest()</code> method returns a string all right that I can use in my C# app (it works, I can display it), so why can't I call that specific C++ method in my C# lib? It's also really my first time coding in C#.</p>