title: Error using a Python Function in C# with IronPython.Hosting
body: <p>I have this code that worked before but not anymore. I do not know why.</p>
  
  <p>I am getting this error.</p>
  
  <p>int.PythonShapeAdd(int x, int y)
  A namespace cannot directly contain members such as fields or methods</p>
  
  <pre><code>using IronPython.Hosting;
  using Microsoft.Scripting.Hosting;
  
  public static int PythonShapeAdd(int x, int y)
  {
  
      ScriptEngine engine3 = Python.CreateEngine();
      ScriptSource source3 = engine3.CreateScriptSourceFromFile("C:\\C#Projects\\ExcelAddIn\\ExcelAddIn\\Shape.py");
      ScriptScope scope3 = engine3.CreateScope();
      source3.Execute(scope3);
  
      dynamic class_object3 = scope3.GetVariable("Shape");
      dynamic class_instance3 = engine3.Operations.CreateInstance(class_object3, x, y);
      int result2 = class_instance3.area();
  
  
      return result2;
  }
  </code></pre>