im using System.CodeDom.Compiler to generate a dynamic code , i need to pass some objects to the functions in code , but when i pass objects they refer to my current name space ...
string code = @"
using System;
using " + type + @";
namespace First
{
public class Program
{
static " + type + ".Class1 " + type.ToLower() + " = (" + type + ".Class1)"+o + @";
public static bool check () {
if( " + exp
+
@")
return true;
else
return false;
}
public static void Main()
{
" +
" Console.WriteLine(\"Hello, world!\");"
+ @"
}
}
}
";
and i get this error : The name 'MineRuleEngine'(my current name space) does not exist in the current context