[Transaction(TransactionOption.Required)]
    [GuidAttribute("64615930-342c-4183-9ca4-8ae1589ebc51")]
    public class CountyRule : ServicedComponent
    {
        ....
    }

解决方案 »

  1.   

    看看这个是否可以:try
    {
    string s = "fqq";
    Type t = Type.GetTypeFromProgID("MyClass.MyInterface");
    object obj = Activator.CreateInstance(t);
    object[] args = new object[]{s};
    ParameterModifier m = new ParameterModifier(1);
    m[0] = true;
    ParameterModifier[] pma = {m};
    object result = t.InvokeMember("MyMethod",BindingFlags.InvokeMethod | BindingFlags.Instance ,null,obj,args,pma,System.Globalization.CultureInfo.CreateSpecificCulture("zh-cn"),null);
    s = Convert.ToString(args[0]);
    textBox1.Text = s;
    }
    catch(Exception ex)
    {
    textBox1.Text = ex.Message;
    this.Text = ex.StackTrace;
    }注意ParameterModifier这部分,和你的MyMethod的参数/返回值类型相关。