title: How to use a C# Enum in C++/CLI
body: <p>I have a C# assembly containing an enum:</p>
  
  <pre><code>public enum MyEnum
  {
      OK = 0, 
      NOT_OK = -1
  }
  </code></pre>
  
  <p>I've added the reference to the <code>C++/CLI</code> project but I don't know how to return a value from a function.</p>
  
  <p>Header:</p>
  
  <pre><code>#pragma once
  
  using namespace System;
  using namespace MyNamespace;
  
  namespace NativeWrapper {
  
      public ref class API
      {
          public:
              static MyNamespace::MyEnum Go();
      };
  
  }
  </code></pre>
  
  <p>CPP:</p>
  
  <pre><code>#include "StdAfx.h"
  #include "API.h"
  
  using namespace NativeWrapper;
  
  MyNamespace::MyEnum API::Go()
  {
      return MyEnum.OK;
  }
  </code></pre>
  
  <p>I get the following when I build the project:</p>
  
  <p><code>error C2275: 'MyNamespace::MyEnum' : illegal use of this type as an expression</code></p>