Title: Using C# dynamic typing in Unity 5.3.1f
Tags: c#;unity3d;ironpython;dynamic-typing
Question: I have written code for my game that need to run a function of my python code. I am using Ironpython for my project.
However, when I am trying to use C# dynamic typing to call a function in the code below, it compiles but I get the following error from the Internals:

```
  " Assets/Scripts/WordSearchAlgorithm.cs(37,29): error CS1502:
  The best overloaded method match for
  System.Runtime.CompilerServices.CallSite,object>>.Create(System.Runtime.CompilerServices.CallSiteBinder)'
  has some invalid arguments " "
  Assets/Scripts/WordSearchAlgorithm.cs(37,29): error CS1503: Argument
  '#1' cannot convert 'object' expression to type
  'System.Runtime.CompilerServices.CallSiteBinder' " "
  Assets/Scripts/WordSearchAlgorithm.cs(37,61): error CS0234: The type
  or namespace name 'RuntimeBinder' does not exist in the namespace
  `Microsoft.CSharp'. Are you missing an assembly reference?  "
  Assets/Scripts/WordSearchAlgorithm.cs(37,61): error CS1502: The best
  overloaded method match for 'System.Runtime.CompilerServices.CallSite>.Create(System.Runtime.CompilerServices.CallSiteBinder)' has some invalid arguments
```

I think mono doesn't support this. Could you please give me a solution to help me?

```static public void StartSearchAlgorithm()
{
    List < string &gt; myList = new List < string &gt; ()
    {
        "fxie",
         "amlo",
         "ewbx",
         "astu"
    };
    var ironPythonRuntime = Python.CreateRuntime();
    try
    {
        //Load the Iron Python file/script into the memory
        //Should be resolve at runtime
        dynamic loadIPython = ironPythonRuntime.UseFile("C:/py.py");
        //Invoke the method and print the result
        loadIPython.BoggleWords(myList, loadIPython.MakeTrie("C:/words.txt")); // here is my problem to calling function from python that unity logError
        //    Debug.Log(string.Format("dd", loadIPython.BoggleWords(myList, loadIPython.MakeTrie("C:/words.txt"))));
    }
    catch (FileNotFoundException ex)
    {}
}
```



Here is another answer: Unity uses the Mono 2.0 version of .NET, which is similar to .NET 3.5. ```dynamic``` was introduced in .NET 4.0, so Unity will probably not compile.

There is the option to change Mono 2.0 sub to Mono 2.0 full in the Player Settings, but I don't know if that supports ```dynamic```. At least you can try.



Comment for this answer: Then it is not supported in Mono 2.0. Also see this answer: http://answers.unity3d.com/questions/686244/using-c-dynamic-typing-with-unity-434f1.html
Comment for this answer: Can you find an IronPython library that uses .NET 3.5 maybe?
Comment for this answer: IronPython 2.7.5 seems to have Net35 dll's as well. Try to reference those in your project and see if it doesn't use `dynamic`.
Comment for this answer: I am trying to change Mono 2.0 sub to Mono 2.0 full in the Player Settings but error still exist
Comment for this answer: Thanks Marnix for your Answering , I had seen this topic before but like code above. I want to call my Python function that without using C# dynamic typing do not work . I don't know maybe should change my coding
Comment for this answer: I had used IronPython 2.6 from C#4.0 , but unity had errors for its Libraries

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2016:00:03/18/16', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<c#><unity3d><ironpython><dynamic-typing>', 'Title': 'Using C# dynamic typing in Unity 5.3.1f', 'ViewCount': 5065, 'id': 36079609, 'user_AboutMe': None, 'user_AccountId': 7950998.0, 'user_DisplayName': 'Amirhossein Etaat', 'user_Reputation': 41.0, 'user_Views': 11.0, 'user_id': 6001843.0}}