Compilación dinámica de C # y error "Microsoft.CSharp.dll"
Estoy haciendo el ejemplo que se puede encontrar.aquí. Así que estoy intentando ejecutar IronPython en un script de C #:
Pitón:
def hello(name):
print "Hello " + name + "! Welcome to IronPython!"
return
def add(x, y):
print "%i + %i = %i" % (x, y, (x + y))
return
def multiply(x, y):
print "%i * %i = %i" % (x, y, (x * y))
return
DO#:
using IronPython.Hosting;
using IronPython.Runtime;
using Microsoft.Scripting.Hosting;
using System;
namespace IntroIronPython
{
class IronPythonMain
{
static void Main(string[] args)
{
// Create a new ScriptRuntime for IronPython
Console.WriteLine("Loading IronPython Runtime...");
ScriptRuntime python = Python.CreateRuntime();
try
{
// Attempt to load the python file
Console.WriteLine("Loading Python File...");
// Create a Dynamic Type for our Python File
dynamic pyfile = python.UseFile("PythonFunctions.py");
Console.WriteLine("Python File Loaded!");
Console.WriteLine("Running Python Commands...\n");
// Call the hello(name) function
pyfile.hello("Urda");
…
Y desde aquí tengo este error: "La operación dinámica no se puede compilar sin la referencia del ensamblaje" Microsoft.CSharp.dll "". Y, en serio, no entiendo de qué se trata, ¿qué olvidé agregar?
En mis referencias tengo:
Gracias por tu ayuda.
Ps: estoy en MonoDevelop.